/**
 * Main stylesheet for TheDigiLearner theme
 */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a73e8;
    --secondary-color: #2c3e50;
    --accent-color: #34a853;
    --text-color: #202124;
    --light-text: #5f6368;
    --background-color: #ffffff;
    --light-background: #f8f9fa;
    --border-color: #dadce0;
    --container-width: 1200px;
    --content-width: 800px;
    --sidebar-width: 350px;
    --header-height: 80px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: #f9f9f9;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.site-branding .site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.site-branding .site-title a {
    text-decoration: none;
    color: inherit;
}

.site-description {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-top: 5px;
}

/* Navigation */
.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-navigation a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* Main Content */
.site-main {
    padding: 40px 0;
}

.content-area {
    max-width: var(--content-width);
    margin: 0 auto;
    width: 100%;
}

.has-sidebar .content-area {
    max-width: calc(var(--content-width) - var(--sidebar-width) - 40px);
    margin-right: 40px;
}

/* Ad Spaces */
.tdl-ad-space-wrapper {
    margin: 30px 0;
    text-align: center;
}

.tdl-header-ad {
    margin: 20px 0;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.tdl-footer-ad {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
}

.tdl-ad-space {
    background: var(--light-background);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    color: var(--light-text);
    position: relative;
}

.tdl-ad-space::before {
    content: attr(data-label);
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--background-color);
    padding: 0 10px;
    font-size: 12px;
    color: var(--light-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tdl-middle-content-ad {
    margin: 40px 0;
    background: #f8fff8;
    border: 1px solid #d4edda;
}

/* Single Article */
.tdl-single-article {
    background: var(--background-color);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.entry-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.entry-title {
    font-size: 2.5rem;
    line-height: 1.3;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--light-text);
}

.entry-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.entry-meta span::before {
    content: '•';
    margin-right: 5px;
}

.entry-meta span:first-child::before {
    content: '';
    margin-right: 0;
}

.reading-time {
    background: #e8f4fc;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
}

/* Post Content */
.post-thumbnail {
    margin: 30px 0;
    text-align: center;
}

.post-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

.entry-content > * {
    margin-bottom: 1.5rem;
}

.entry-content h2 {
    color: #34495e;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 1.8rem;
}

.entry-content h3 {
    color: #2c3e50;
    margin-top: 30px;
    font-size: 1.5rem;
}

/* Styling from your blog article */
.digital-learner-tip {
    background: #e8f4fc;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

.warning {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

.checklist {
    background: #f8fff8;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #d4edda;
    margin: 30px 0;
}

.checklist ul {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.checklist input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

/* Tables */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95em;
}

.entry-content th {
    background: #f2f6fa;
    padding: 15px;
    text-align: left;
    border: 1px solid #ddd;
    font-weight: 600;
}

.entry-content td {
    padding: 15px;
    border: 1px solid #ddd;
}

/* Code blocks */
.entry-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.entry-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

/* Article Footer */
.entry-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.cat-links a,
.tags-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin-right: 10px;
}

.cat-links a:hover,
.tags-links a:hover {
    text-decoration: underline;
}

/* Author Bio */
.author-bio {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    background: var(--light-background);
    border-radius: 8px;
    margin: 30px 0;
}

.author-avatar img {
    border-radius: 50%;
}

.author-info {
    flex: 1;
}

.author-name {
    margin: 0 0 10px 0;
    color: var(--secondary-color);
}

.author-description {
    margin: 0;
    color: var(--light-text);
}

/* Related Posts */
.related-posts {
    margin-top: 50px;
}

.related-title {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.related-post {
    background: var(--background-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.related-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.related-post-thumbnail {
    display: block;
    overflow: hidden;
    height: 180px;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post:hover .related-post-thumbnail img {
    transform: scale(1.05);
}

.related-post-title {
    padding: 15px;
    margin: 0;
    font-size: 1.1rem;
}

.related-post-title a {
    color: var(--secondary-color);
    text-decoration: none;
}

.related-post-title a:hover {
    color: var(--primary-color);
}

.related-post-date {
    display: block;
    padding: 0 15px 15px;
    font-size: 0.9em;
    color: var(--light-text);
}

/* Sidebar */
.widget-area {
    width: var(--sidebar-width);
}

.sidebar-widgets {
    margin-bottom: 30px;
}

.widget {
    background: var(--light-background);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.widget-title {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* Footer */
.site-footer {
    background: var(--secondary-color);
    color: #fff;
    padding: 50px 0 30px;
    margin-top: 60px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-widget {
    color: #ccc;
}

.footer-widget-title {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-menu ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.footer-menu a {
    color: #ccc;
    text-decoration: none;
}

.footer-menu a:hover {
    color: #fff;
}

.footer-copyright {
    color: #999;
    font-size: 0.9rem;
}

/* Contact Form */
.tdl-contact-form {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tdl-contact-form h2 {
    margin-bottom: 30px;
    color: var(--secondary-color);
}

.tdl-contact-success {
    background: #d4edda;
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    margin: 40px 0;
    text-align: center;
}

.tdl-contact-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.tdl-contact-form .form-group {
    margin-bottom: 20px;
}

.tdl-contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.tdl-contact-form input[type="text"],
.tdl-contact-form input[type="email"],
.tdl-contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

.tdl-contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

.tdl-contact-form .submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.tdl-contact-form .submit-btn:hover {
    background: #0d62d9;
}

/* Responsive Design */
@media (max-width: 992px) {
    .has-sidebar .content-area {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 40px;
    }
    
    .widget-area {
        width: 100%;
    }
    
    .related-posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background-color);
        padding: 20px;
        border-top: 1px solid var(--border-color);
        z-index: 1000;
    }
    
    .main-navigation.active ul {
        display: flex;
    }
    
    .entry-title {
        font-size: 2rem;
    }
    
    .tdl-single-article {
        padding: 25px;
    }
    
    .entry-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .footer-menu ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* Print Styles */
@media print {
    .tdl-ad-space-wrapper,
    .tdl-ad-space,
    .widget-area,
    .site-footer,
    .menu-toggle,
    .main-navigation {
        display: none !important;
    }
    
    .content-area {
        max-width: 100%;
    }
    
    .tdl-single-article {
        box-shadow: none;
        padding: 0;
    }
}