/**
 * Dark Mode Styles
 * @package Modern_Blog
 */

/* ===== DARK MODE VARIABLES ===== */
body.dark-mode {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --white: #1e293b;
    --border: rgba(148, 163, 184, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ===== DARK MODE TOGGLE BUTTON ===== */
.dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    transform: translateY(-3px) rotate(15deg);
    box-shadow: 0 8px 30px rgba(0, 122, 255, 0.6);
}

.dark-mode-toggle i {
    transition: transform 0.5s ease;
}

.dark-mode .dark-mode-toggle i {
    transform: rotate(180deg);
}

/* ===== DARK MODE BASE STYLES ===== */
body.dark-mode {
    background-color: var(--bg);
    background-image: 
        linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
    color: var(--text);
}

/* Header */
body.dark-mode .site-header {
    background: rgba(30, 41, 59, 0.8);
    border-bottom-color: rgba(148, 163, 184, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

body.dark-mode .site-title {
    background: linear-gradient(135deg, #e2e8f0 0%, #007AFF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode .main-navigation a {
    color: var(--text);
}

body.dark-mode .main-navigation a::before {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2), rgba(139, 92, 246, 0.2));
}

/* Post Cards */
body.dark-mode .post-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.1);
    box-shadow: 
        0 10px 30px -5px rgba(0, 0, 0, 0.3),
        0 20px 60px -10px rgba(0, 122, 255, 0.15);
}

body.dark-mode .post-card:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--primary);
}

/* Typography */
body.dark-mode .post-title,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
    color: var(--text);
}

body.dark-mode .post-meta {
    color: var(--text-light);
}

body.dark-mode .post-excerpt {
    color: var(--text-light);
}

/* Categories */
body.dark-mode .post-category {
    background: rgba(0, 122, 255, 0.15);
    border-color: rgba(0, 122, 255, 0.3);
}

/* Buttons */
body.dark-mode .read-more {
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

body.dark-mode .read-more:hover {
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.6);
}

/* Featured Banner */
body.dark-mode .featured-banner {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

/* Sidebar Widgets */
body.dark-mode .widget {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

body.dark-mode .widget-title {
    color: var(--text);
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

body.dark-mode .recent-post-title a,
body.dark-mode .popular-post-title a {
    color: var(--text);
}

body.dark-mode .recent-post-title a:hover,
body.dark-mode .popular-post-title a:hover {
    color: var(--primary);
}

/* Footer */
body.dark-mode .site-footer {
    background: #0f172a;
    border-top-color: rgba(148, 163, 184, 0.1);
    color: var(--text-light);
}

body.dark-mode .site-footer a {
    color: var(--text);
}

body.dark-mode .site-footer a:hover {
    color: var(--primary);
}

/* Comments */
body.dark-mode .comments-area {
    border-top-color: rgba(148, 163, 184, 0.2);
}

body.dark-mode .comment-respond {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(148, 163, 184, 0.1);
}

body.dark-mode .comment-form input[type="text"],
body.dark-mode .comment-form input[type="email"],
body.dark-mode .comment-form input[type="url"],
body.dark-mode .comment-form textarea {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
    color: var(--text);
}

body.dark-mode .comment-form input:focus,
body.dark-mode .comment-form textarea:focus {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--primary);
}

body.dark-mode .comment-body {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(148, 163, 184, 0.1);
}

/* Code Blocks */
body.dark-mode .post-body pre {
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

body.dark-mode .post-body code {
    background: rgba(30, 41, 59, 0.6);
    color: #f472b6;
}

body.dark-mode .post-body blockquote {
    background: rgba(30, 41, 59, 0.4);
    border-left-color: var(--primary);
}

/* Author Box */
body.dark-mode .author-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.6) 100%);
    border-color: rgba(148, 163, 184, 0.1);
}

/* Post Navigation */
body.dark-mode .post-navigation a {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.1);
}

body.dark-mode .post-navigation a:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(139, 92, 246, 0.1));
}

/* Pagination */
body.dark-mode .pagination span,
body.dark-mode .pagination a {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    color: var(--text);
}

body.dark-mode .pagination a:hover,
body.dark-mode .pagination .current {
    background: var(--primary);
    color: white;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(30, 41, 59, 0.9);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 50%;
    color: var(--primary);
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

body.dark-mode .back-to-top {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
}

/* Toast Notifications */
.modern-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: all 0.3s ease;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.modern-toast.show {
    bottom: 30px;
}

.modern-toast.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.modern-toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(148, 163, 184, 0.1);
    z-index: 9999;
}

.reading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #8B5CF6, #EC4899);
    width: 0%;
    transition: width 0.1s ease;
}

/* Social Share Buttons */
body.dark-mode .social-share {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin: 30px 0;
}

body.dark-mode .social-share-title {
    color: var(--text);
    margin-bottom: 15px;
}

.social-share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-button:hover {
    transform: translateY(-2px);
}

.share-button.facebook {
    background: #1877f2;
    color: white;
}

.share-button.twitter {
    background: #1da1f2;
    color: white;
}

.share-button.linkedin {
    background: #0077b5;
    color: white;
}

.share-button.copy-link {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text);
}

body.dark-mode .share-button.copy-link {
    background: rgba(148, 163, 184, 0.1);
}

.share-button.copied {
    background: #10b981 !important;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
}

.menu-icon {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text);
    position: relative;
    transition: all 0.3s ease;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s ease;
}

.menu-icon::before {
    top: -8px;
}

.menu-icon::after {
    bottom: -8px;
}

.mobile-menu-toggle.active .menu-icon {
    background: transparent;
}

.mobile-menu-toggle.active .menu-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle.active .menu-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg);
        padding: 80px 20px 20px;
        transition: right 0.3s ease;
        z-index: 100;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }

    body.dark-mode .main-navigation {
        background: #1e293b;
    }

    .main-navigation.active {
        right: 0;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .main-navigation a {
        padding: 15px 20px;
        display: block;
        border-radius: 8px;
        margin-bottom: 5px;
    }

    .dark-mode-toggle,
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .back-to-top.visible {
        bottom: 80px;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease;
}

button,
a,
.post-card {
    transition: all 0.3s ease;
}