/* includes/style.css */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;700;800&display=swap');

:root {
            --bg: #f8fafc;
            --primary: #0284c7;
            --orange: #f97316;
            --text: #0f172a;
            --text-muted: #475569;
            --border-color: #e2e8f0;
            --font-stack: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
        }

        /* --- DARK MODE OVERRIDES (MANUAL TRIGGER) --- */
        body.dark-mode {
            --bg: #0a0a0a;
            --text: #ffffff;
            --text-muted: #a0a0a0;
            --border-color: #262626;
        }

        body.dark-mode { background-color: var(--bg); }

        /* Header & Logo */
        body.dark-mode .header-section h1 { color: #ffffff !important; }
        body.dark-mode .brand-logo { filter: brightness(0) invert(1); }
        body.dark-mode .section-title { color: #ffffff !important; }

        /* Menu System */
        body.dark-mode .nav-icon { fill: #ffffff !important; }
        body.dark-mode .nav-label { color: #ffffff !important; }
        body.dark-mode .nav-icon-circle { background: #171717 !important; border-color: #ffffff !important; }
        body.dark-mode .nav-item.active .nav-icon-circle, body.dark-mode .nav-item:hover .nav-icon-circle {
            background: #1e293b !important; border-color: var(--primary) !important;
        }
        body.dark-mode .nav-item.active .nav-icon, body.dark-mode .nav-item.active .nav-label {
            fill: var(--primary) !important; color: var(--primary) !important;
        }

        /* Containers */
        body.dark-mode #dynamic-content-area, body.dark-mode .db-card, body.dark-mode .modal-content, body.dark-mode .maintenance-section {
            background: #171717 !important; 
            border-color: #262626 !important;
            color: #ffffff !important;
        }
        body.dark-mode .maintenance-section h2 { color: #ffffff !important; }
        body.dark-mode .maintenance-section p { color: #a0a0a0 !important; }

        /* Accordions */
        body.dark-mode .accordion-header { background-color: #171717 !important; color: #ffffff !important; border-bottom: 1px solid #262626 !important; }
        body.dark-mode .accordion-header:hover { background-color: #262626 !important; }
        body.dark-mode .accordion-content { background-color: #0a0a0a !important; }
        body.dark-mode .accordion-inner { color: #a0a0a0 !important; }

        /* Contact & Forms */
        body.dark-mode .info-box { background: #171717 !important; border-color: #262626 !important; }
        body.dark-mode .contact-form input, body.dark-mode .contact-form textarea {
            background: #0a0a0a !important; color: white !important; border-color: #262626 !important;
        }
        body.dark-mode .modal-content img { filter: brightness(0) invert(1); }
        body.dark-mode #popup-desc { color: #a0a0a0 !important; }

        /* --- Toggle Icon Styling & Animation --- */
        .theme-toggle-btn {
            background: none;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 5px;
            transition: transform 0.3s ease;
        }
        .theme-toggle-btn:hover { transform: scale(1.1); }
        .theme-toggle-btn svg {
            width: 28px;
            height: 28px;
            fill: var(--text-muted);
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }
        body.dark-mode .theme-toggle-btn svg { fill: #facc15; transform: rotate(360deg); }

        * { 
            box-sizing: border-box; 
            margin: 0; 
            padding: 0; 
            font-family: var(--font-stack) !important;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            letter-spacing: 0px;
            word-spacing: 0px;
        }
        
        body { background-color: var(--bg); color: var(--text); line-height: 1.6; transition: background-color 0.3s, color 0.3s; }

        /* In-Page Spinner */
        #page-loader-container { display: none; text-align: center; padding: 50px 0; }
        .spinner {
            width: 40px; height: 40px; border: 4px solid #eee;
            border-top: 4px solid var(--primary); border-radius: 50%;
            animation: spin 0.8s linear infinite; margin: 0 auto;
        }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        /* Header Section */
        .header-section { padding: 70px 20px 20px; text-align: center; }
        .brand-logo { width: 60px; height: auto; margin-bottom: 10px; object-fit: contain; }
        .header-section h1 { font-size: 3rem; color: #000; font-weight: 800; margin-bottom: 5px; line-height: 1.2; }
        .header-section h2 { font-size: 1.2rem; margin-bottom: 20px; font-weight: 400; letter-spacing: 2px; }
        .header-section p { color: var(--text-muted); max-width: 600px; margin: 0 auto 30px; font-size: 1.2rem; }

        /* Icon Navigation Menu */
        .nav-menu { display: flex; justify-content: center; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
        .nav-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: 0.3s; padding: 10px; border-radius: 15px; width: 90px; background: transparent; }
        
        .nav-icon-circle { width: 55px; height: 55px; background: #fff; border: 1px solid var(--border-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; transition: 0.3s; }
        .nav-icon { width: 26px; height: 26px; fill: var(--text-muted); transition: 0.3s; }
        .nav-label { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); transition: 0.3s; }

        /* States: Active & Hover */
        .nav-item:hover .nav-icon-circle, .nav-item.active .nav-icon-circle { border-color: var(--primary); }
        .nav-item:hover .nav-icon, .nav-item.active .nav-icon { fill: var(--primary); }
        .nav-item:hover .nav-label, .nav-item.active .nav-label { color: var(--primary); }
        
        #nav-samples.active .nav-icon-circle, 
        #nav-samples:hover .nav-icon-circle { 
            border-color: var(--orange) !important; 
        }
        #nav-samples.active .nav-icon, 
        #nav-samples:hover .nav-icon { 
            fill: var(--orange) !important; 
        }
        #nav-samples.active .nav-label, 
        #nav-samples:hover .nav-label { 
            color: var(--orange) !important; 
        }

        /* Social Icons Styles */
        .header-socials { display: flex; justify-content: center; align-items: center; gap: 25px; margin-top: 10px; margin-bottom: 40px; }
        .header-socials a { transition: 0.3s; text-decoration: none; display: flex; align-items: center; justify-content: center; }
        .header-socials svg { width: 28px; height: 28px; fill: var(--text-muted); transition: 0.3s; }
        .header-socials a:hover svg { transform: scale(1.15); fill: var(--primary); }

        /* Dynamic Content Area */
        #dynamic-content-area { display: none; max-width: 700px; margin: 0 auto 50px; padding: 25px; background: #fff; border-radius: 24px; border: 1px solid var(--border-color); text-align: right; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }

        /* Our Works Intro */
        .our-works-intro { text-align: center; margin-bottom: 20px; padding: 0 20px; }
        .our-works-intro h3 { font-size: 1.8rem; font-weight: 800; color: var(--text); margin-bottom: 10px; }
        .our-works-intro p { color: var(--text-muted); max-width: 700px; margin: 0 auto; font-size: 1.07rem; }

        /* Grid */
        .container { max-width: 1200px; margin: 0 auto 50px; padding: 0 20px; }
        .db-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 25px; }
        .db-card { background: #fff; border-radius: 24px; overflow: hidden; border: 1px solid var(--border-color); transition: 0.4s; cursor: pointer; }
        .db-card:hover { border-color: var(--primary); transform: translateY(-5px); }
        .db-img { width: 100%; height: 200px; object-fit: cover; }
        .db-content { padding: 25px; }
        .db-content h3 { font-size: 1.5rem; margin-bottom: 12px; color: var(--primary); font-weight: 800; }
        .db-content p { color: var(--text-muted); font-size: 1.07rem; line-height: 1.7; }

        /* Maintenance Section */
        .maintenance-section { margin-top: 80px; padding: 40px 20px; background: #fff; border-radius: 30px; border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0,0,0,0.02); }
        .maintenance-section h3 { font-size: 1.8rem; font-weight: 800; margin-bottom: 40px; color: var(--primary); text-align: center; position: relative; }
        .maintenance-section h3::after { content: ''; display: block; width: 50px; height: 4px; background: var(--primary); margin: 10px auto; border-radius: 2px; }
        .support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
        .support-item { text-align: center; padding: 20px; transition: 0.3s; }
        .support-icon-wrapper { width: 70px; height: 70px; background: #e0f2fe; border-radius: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; transition: 0.3s; }
        .support-item:hover .support-icon-wrapper { transform: rotate(10deg); background: var(--primary); }
        .support-icon { width: 35px; height: 35px; fill: var(--primary); transition: 0.3s; }
        .support-item:hover .support-icon { fill: #fff; }
        .support-item h4 { color: var(--text); margin-bottom: 12px; font-weight: 800; font-size: 1.2rem; }
        .support-item p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.8; }

        /* FAQ Section Styling */
        .faq-section { margin-top: 80px; }
        .faq-section h3 { text-align: center; font-size: 1.8rem; font-weight: 800; margin-bottom: 30px; color: var(--text); }
        .faq-container { background: #fff; border-radius: 20px; border: 1px solid var(--border-color); overflow: hidden; }

        /* MODAL STYLING */
        .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px); z-index: 1000; align-items: center; justify-content: center; }
        .modal-content { background: #fff; width: 90%; max-width: 500px; padding: 30px; border-radius: 20px; position: relative; border: 1px solid var(--border-color); max-height: 90vh; overflow-y: auto; }
        .modal-content h2 { font-size: 1.5rem; color: var(--primary); margin-bottom: 15px; font-weight: 800; }
        .modal-content p { font-size: 1rem; color: var(--text-muted); line-height: 1.6; }
        .close-x { position: absolute; top: 15px; left: 15px; font-size: 25px; cursor: pointer; color: var(--text-muted); }

        .info-box {
            display: flex;
            align-items: center;    
            justify-content: center; 
            gap: 12px;              
            padding: 12px;
            margin-bottom: 10px;
            background: #f8fafc;
            border-radius: 12px;
            width: 100%;
            direction: rtl;         
        }

        .info-content {
            display: flex;
            gap: 5px;               
            align-items: center;
        }

        .info-box i, .info-box svg {
            font-size: 1.2rem;
            color: var(--primary);
            flex-shrink: 0;         
        }
        .contact-info-list p { font-size: 1.0rem; margin-bottom: 0px; color: var(--text-muted); }
        .contact-info-list a { color: var(--text-muted); text-decoration: none; }
        
        .contact-form { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
        .contact-form input, .contact-form textarea { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 16px; background: #fff; text-align: right; direction: rtl; }
        
        .submit-btn { background: var(--primary); color: white; border: none; padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 16px; }

        /* Accordion Styling */
        .accordion-item { border-bottom: 1px solid var(--border-color); }
        .accordion-header { width: 100%; padding: 15px; text-align: right; background: none; border: none; font-weight: 600; font-size: 1.0rem; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; }
        .accordion-header:hover { background: #f1f5f9; }
        .accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background: #fbfcfd; }
        .accordion-inner { padding: 15px; font-size: 0.9rem; color: var(--text-muted); }
        .demo-link { display: inline-block; margin-top: 10px; color: var(--primary); font-weight: 700; text-decoration: none; font-size: 0.85rem; }

        footer { text-align: center; font-size: 1.0rem; padding: 40px; color: var(--text-muted); border-top: 1px solid var(--border-color); }
        
        .section-title {
            color: var(--primary); 
            font-size: 1.9rem;      
            font-weight: 800;      
            margin-bottom: 15px;   
            text-align: center;     
        }

        .minimal-load {
            background: rgba(255, 255, 255, 0.05) !important;
            backdrop-filter: blur(10px) !important;
            -webkit-backdrop-filter: blur(10px) !important;
        }

        .minimal-load .modal-content {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
        }

        .minimal-load #wait-text {
            display: none !important;
        }

        /* --- MOBILE SPECIFIC FIXES --- */
        @media (max-width: 768px) {
            .header-section { padding: 35px 15px 10px; } 
            .brand-logo { width: 55px; margin-bottom: 5px; }
            .header-section h1 { font-size: 2.2rem; margin-bottom: 5px; } 
            .header-section h2 { font-size: 1.0rem; margin-bottom: 12px; letter-spacing: 1px; }
            .header-section p { font-size: 1.08rem; margin-bottom: 15px; line-height: 1.4; padding: 0 10px; }

            .nav-menu { gap: 8px; margin-bottom: 20px; }
            .nav-item { width: 75px; padding: 5px; }
            .nav-icon-circle { width: 45px; height: 45px; margin-bottom: 5px; }
            .nav-icon { width: 25px; height: 25px; }
            .nav-label { font-size: 0.8rem; }

            .header-socials { margin-bottom: 25px; margin-top: 25px; gap: 20px; }
            .header-socials svg { width: 26px; height: 26px; }

            .our-works-intro { margin-bottom: 15px; }
            .our-works-intro h3 { font-size: 1.5rem; }
            .our-works-intro p { font-size: 1.0rem; }

            .container { padding: 0 15px; margin-bottom: 30px; }
            .db-grid { grid-template-columns: 1fr; gap: 12px; }
            .db-card { display: flex; align-items: center; border-radius: 16px; height: 120px; }
            .db-img { width: 100px; height: 100% !important; flex-shrink: 0; }
            .db-content { padding: 10px 15px; overflow: hidden; }
            .db-content h3 { font-size: 1.03rem; margin-bottom: 2px; }
            .db-content p { font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }

            .maintenance-section { margin-top: 40px; padding: 25px 15px; border-radius: 20px; }
            .maintenance-section h3 { font-size: 1.4rem; margin-bottom: 25px; }
            .support-grid { grid-template-columns: 1fr; gap: 10px; }
            .support-item { display: flex; flex-direction: row; text-align: right; align-items: center; background: transparent; border: none; padding: 10px 0; }
            .support-icon-wrapper { width: 45px; height: 45px; margin: 0 0 0 2px; flex-shrink: 0; order: 2; border-radius: 12px; }
            .support-icon { width: 22px; height: 22px; }
            .support-text-container { order: 1; flex: 1; }
            .support-item h4 { font-size: 1.03rem; margin-bottom: 2px; }
            .support-item p { font-size: 1.0rem; line-height: 1.4; }

            .faq-section { margin-top: 40px; }
            .faq-section h3 { font-size: 1.4rem; margin-bottom: 20px; }
            .accordion-header { width: 100%; padding: 15px; text-align: right; background: none; border: none; font-weight: 600; font-size: 0.85rem; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; }
            
            .contact-info-list p { font-size: 0.9rem; margin-bottom: 3px; color: var(--text-muted); }
            .info-box { margin-bottom: 5px !important 0; background: var(--bg); padding: 10px !important; border-radius: 10px; border: 1px solid var(--border-color); }
                    
            .modal-content { 
                width: 80% !important;   
                max-width: 320px;        
                padding: 20px !important; 
                border-radius: 20px;     
            }

            .modal-content h2 {
                font-size: 1.2rem !important;
                margin-bottom: 10px;
            }
            
            .modal-content p {
                font-size: 1.0rem !important;
                line-height: 1.5;
            }

            .modal-content .submit-btn {
                padding: 10px;
                font-size: 1.0rem;
            }

            #dynamic-content-area {
                width: 95% !important;   
                max-width: 340px;        
                margin: 0 auto 30px;     
                padding: 15px !important; 
            }

            .contact-form {
                gap: 8px !important;     
            }

            .contact-form input {
                padding: 8px 12px !important; 
                height: 43px;                 
                width: 100%;                  
            } 
            .contact-form textarea {
                padding: 10px !important; 
                font-size: 1rem !important; 
            }

            .contact-form textarea {
                height: 60px !important;  
            }

            .submit-btn {
                padding: 10px !important; 
                font-size: 0.95rem !important;
            }
                    
            footer { padding: 20px; font-size: 1.0rem; }
        }
        
        .db-card p {
            display: -webkit-box;
            -webkit-box-orient: vertical;
            overflow: hidden;
            line-height: 1.5em; 
        }

        @media (min-width: 768px) {
            .db-card p {
                -webkit-line-clamp: 5;
                height: 7.5em; 
            }
        }
        
        /* Special Card with Blue/Orange Gradient (Green Removed) */
        .web-special-card {
            border: 3px solid transparent !important;
            background: 
                linear-gradient(var(--bg), var(--bg)) padding-box,
                linear-gradient(to right, #0284c7, #f97316) border-box !important;
        }

        /* Desktop Version: Full Width (3 cards wide) */
        @media (min-width: 1024px) {
            .web-special-card {
                grid-column: 1 / -1; 
                display: flex !important;
                flex-direction: row-reverse;
                align-items: center;
                height: 320px;
            }

            .web-special-card .db-img {
                width: 45%;
                height: 100% !important;
            }

            .web-special-card .db-content {
                width: 55%;
                padding: 40px;
            }
        }

        /* Mobile Adjustments */
        @media (max-width: 768px) {
            .web-special-card {
                grid-column: auto;
            }
        }