/* =========================================
   1. VARIABLES & THEME CONFIGURATION
   ========================================= */
:root {
    /* Light Mode (Default) */
    --primary-color: #d35400; /* Default Orange */
    --primary-hover: #b04600;
    --bg-main: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --placeholder-color: #6c757d; 
    --input-bg: #ffffff;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-main: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #2d2d2d;
    --text-main: #f8f9fa;
    --text-muted: #d1d1d1;
    --border-color: #444;
    --placeholder-color: #a0a0a0;
    --input-bg: #2d2d2d;
}

/* Dark Mode Text Fixes */
[data-theme="dark"] .text-muted { color: #b0b3b8 !important; }
[data-theme="dark"] .form-label.text-muted { color: #d1d1d1 !important; }
[data-theme="dark"] .accordion-body.text-muted { color: #b0b3b8 !important; }

/* =========================================
   2. GLOBAL RESETS & TYPOGRAPHY
   ========================================= */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

/* Utilities */
.bg-light-dynamic { background-color: var(--bg-secondary) !important; }
.text-primary-custom { color: var(--primary-color) !important; }
.bg-primary-custom { background-color: var(--primary-color) !important; color: white; }
.text-white { color: #ffffff !important; }
.letter-spacing-2 { letter-spacing: 2px; }

/* Global Card Reset */
.card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

/* =========================================
   3. NAVBAR & LOGO
   ========================================= */
.navbar {
    background-color: var(--bg-main);
}

.navbar .nav-link {
    color: var(--text-main) !important;
    transition: color 0.3s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--primary-color) !important;
}

.site-logo {
    height: 60px; 
    width: auto;  
    object-fit: contain;
}

@media (max-width: 768px) {
    .site-logo { height: 40px; }
}

/* Dark Mode Hamburger Icon Fix */
[data-theme="dark"] .navbar-toggler { border-color: var(--border-color); }
[data-theme="dark"] .navbar-toggler-icon { filter: invert(1) grayscale(100%) brightness(200%); }

/* =========================================
   4. NEW THEME SETTINGS WIDGET (Left Center)
   ========================================= */
.theme-settings-widget {
    position: fixed;
    top: 50%;              /* Move to vertical middle */
    left: 20px;            /* 20px from left edge */
    transform: translateY(-50%); /* Perfectly center it */
    z-index: 9999;
    display: flex;
    flex-direction: row;   /* Stack panel next to button */
    align-items: center;   /* Align items vertically */
}

/* The Panel (Pops out to the RIGHT now) */
.settings-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 250px;
    padding: 20px;
    border-radius: 12px;
    
    /* Animation Initial State */
    opacity: 0;
    visibility: hidden;
    position: absolute;
    left: 70px; /* Push it to the right of the button */
    transform: translateX(-20px); /* Start slightly left for slide effect */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 5px 5px 20px rgba(0,0,0,0.1);
}

/* Active State (Visible) */
.settings-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* The Gear Button */
#settingsTrigger {
    width: 50px; 
    height: 50px; 
    border-radius: 50%;
    font-size: 1.2rem; 
    transition: transform 0.3s ease;
    /* Ensure it sits on top of the panel border if they overlap slightly */
    position: relative; 
    z-index: 2; 
}

/* Color Dots inside the panel */
.color-dot {
    width: 30px; 
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.color-dot:hover { transform: scale(1.2); }

/* Gear Icon Animation */
.fa-spin-hover:hover { animation: fa-spin 2s infinite linear; }
#settingsTrigger.active { transform: rotate(90deg); }

/* =========================================
   5. BUTTONS & UI ELEMENTS
   ========================================= */
.btn-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff !important;
    transition: all 0.3s ease;
}

.btn-custom:hover, .btn-custom:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Gallery Filter Buttons */
.filter-btn {
    border-color: var(--border-color);
    color: var(--text-main);
    background: transparent;
    margin: 5px;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* =========================================
   6. FORMS
   ========================================= */
.form-control, .form-select {
    background-color: var(--bg-secondary) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(211, 84, 0, 0.25);
}

.form-control::placeholder {
    color: var(--placeholder-color) !important;
    opacity: 1;
}

/* =========================================
   7. PAGE SPECIFIC SECTIONS
   ========================================= */

/* --- Tech & Process Steps --- */
.innovative-step {
    border-left: 3px solid var(--border-color);
    padding-left: 30px;
    position: relative;
    padding-bottom: 40px;
}
.innovative-step:last-child { border-left: 3px solid transparent; }

.step-badge {
    position: absolute; left: -16px; top: 0;
    width: 32px; height: 32px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    box-shadow: 0 0 0 5px var(--bg-main);
}

.tech-card-modern {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.3s ease;
}
.tech-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

/* --- Gallery & Projects --- */
.project-card, .gallery-item {
    transition: opacity 0.4s ease;
}
.project-card img { transition: transform 0.5s ease; }
.project-card:hover img { transform: scale(1.1); }

.project-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.project-card:hover .project-overlay { opacity: 1; }

/* --- Team Cards --- */
.team-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}
.team-overlay {
    position: absolute; top: 10px; right: 10px;
}

/* --- Testimonials --- */
.testimonial-card {
    transition: transform 0.3s ease;
}
.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

/* --- 404 Error Page --- */
.error-container {
    min-height: 80vh;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--bg-main);
    text-align: center;
}
.error-code {
    font-family: 'Courier New', monospace;
    font-size: 8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
    line-height: 1;
}
.error-message {
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* --- Why Choose Page --- */
.bg-card { background-color: var(--bg-card); }
@media (max-width: 992px) {
    .border-top { display: none !important; }
}


/* =========================================
   8. FOOTER STYLES
   ========================================= */

/* Footer Links Hover Effect (Slide Right) */
.footer-links li { margin-bottom: 12px; }
.footer-links a { 
    color: rgba(255,255,255,0.6); 
    text-decoration: none; 
    transition: all 0.3s ease; 
    display: inline-block;
}
.footer-links a:hover { 
    color: var(--primary-color); 
    transform: translateX(8px); 
}

/* Social Buttons (Circle & Hover Bounce) */
.social-btn {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: white !important; /* Forces icon white */
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-btn:hover { 
    background: var(--primary-color) !important; 
    color: white !important; 
    transform: translateY(-5px); /* Bounces up */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Project Thumbnails (Opacity Hover) */
.footer-thumb {
    transition: opacity 0.3s;
    cursor: pointer;
}
.footer-thumb:hover { opacity: 0.7; }

/* Utilities */
.hover-white:hover { color: white !important; }