    /* Base Styles */
    :root {
        /* Light Theme Colors */
        --primary-color: #3b82f6;
        --primary-hover: #2563eb;
        --text-primary: #1f2937;
        --text-secondary: #4b5563;
        --text-muted: #6b7280;
        --bg-primary: #ffffff;
        --bg-secondary: #f9fafb;
        --card-bg: #ffffff;
        --card-border: #e5e7eb;
        --particles-bg: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    }

    /* Dark Theme Overrides */
    .dark {
        --primary-color: #60a5fa;
        --primary-hover: #93c5fd;
        --text-primary: #ffffff;  /* Brighter white for primary text */
        --text-secondary: #e5e7eb;  /* Lighter gray for better contrast */
        --text-muted: #9ca3af;  /* Slightly darker than secondary for hierarchy */
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --card-bg: #1f2937;
        --card-border: #374151;
        --particles-bg: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    }

    /* Base Elements */
    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    /* Text Elements */
    h1, h2, h3, h4, h5, h6 {
        color: var(--text-primary);
        font-weight: 600;
    }

    /* Main content text - ensure good contrast */
    p, li, td, th, label, input, textarea, select, .text-gray-600, .text-gray-700, .text-gray-800 {
        color: var(--text-secondary) !important;
    }

    /* Muted/Secondary text - slightly lighter */
    /* .text-gray-400, .text-gray-500, .text-muted, small, .text-sm {
        color: var(--text-muted) !important;
    } */

    /* Links */
    a {
        color: var(--primary-color);
        transition: color 0.2s ease;
    }

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

    /* Particles Background */
    #particles-js {
        position: fixed;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: -1;
        background: var(--particles-bg);
    }

    /* Navigation */
    .navbar {
        transition: all 0.3s ease;
        background-color: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
    }

    .dark .navbar {
        background-color: rgba(17, 24, 39, 0.95) !important;
    }

    .navbar a {
        color: var(--text-primary) !important;
    }

    .navbar a:hover {
        color: var(--primary-hover) !important;
    }

    /* Project Cards */
    .project-card {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 0.75rem;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
    }

    .project-card .text-gray-600,
    .project-card .text-gray-700,
    .project-card .text-gray-800 {
        color: var(--text-secondary) !important;
    }

    /* Skill Tags - Keep original styling */
    .skill-tag {
        display: inline-block;
        padding: 0.75rem 2.25rem;
        border-radius: 9999px;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.25rem;
        transition: all 0.2s ease;
    }

    /* Ensure tag text is readable in both themes */
    .dark .skill-tag {
        font-weight: 500;
    }

    /* Contact Section */
    #contact {
        background-color: var(--bg-secondary);
        color: var(--text-primary);
        padding: 4rem 1rem;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .contact-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1rem;
    }

    .contact-form {
        background: var(--card-bg);
        border-radius: 12px;
        padding: 2.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        border: 1px solid var(--card-border);
        transition: all 0.3s ease;
    }

    .contact-form:hover {
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    /* Form Elements */
    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: var(--text-primary);
    }

    .form-control {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        line-height: 1.5;
        color: var(--text-primary);
        background-color: var(--bg-primary);
        border: 1px solid var(--card-border);
        border-radius: 0.5rem;
        transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    }

    .form-control:focus {
        border-color: var(--primary-color);
        outline: 0;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    }

    /* Textarea */
    textarea.form-control {
        min-height: 150px;
        resize: vertical;
    }

    /* Submit Button */
    .btn-submit {
        display: inline-block;
        font-weight: 500;
        color: white;
        background-color: var(--primary-color);
        border: none;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        line-height: 1.5;
        border-radius: 0.5rem;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.2s ease;
    }

    .btn-submit:hover {
        background-color: var(--primary-hover);
        transform: translateY(-2px);
    }

    .btn-submit:active {
        transform: translateY(0);
    }

    /* Placeholder Text */
    ::placeholder {
        color: var(--text-muted);
        opacity: 1;
    }

    /* Form Validation */
    .form-control:invalid {
        border-color: #e53e3e;
    }

    .form-feedback {
        display: none;
        margin-top: 0.5rem;
        font-size: 0.875rem;
        color: #e53e3e;
    }

    .was-validated .form-control:invalid ~ .form-feedback {
        display: block;
    }

    /* Success/Error Messages */
    .alert {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 0.5rem;
        font-weight: 500;
    }

    .alert-success {
        background-color: #f0fdf4;
        color: #166534;
        border: 1px solid #86efac;
    }

    .dark .alert-success {
        background-color: #052e16;
        color: #86efac;
        border-color: #166534;
    }

    .alert-error {
        background-color: #fef2f2;
        color: #991b1b;
        border: 1px solid #fca5a5;
    }

    .dark .alert-error {
        background-color: #450a0a;
        color: #fca5a5;
        border-color: #991b1b;
    }

    /* Contact Info Cards */
 /* Contact Info Cards - Updated for dark mode */
.contact-info {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.contact-icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Ensure text in contact cards is visible in both modes */
.contact-card h3,
.contact-card p,
.contact-card a {
    color: var(--text-primary) !important;
}

/* Social Links - ensure they work in dark mode */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--primary-color);
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

/* Responsive layout for contact cards */
@media (min-width: 768px) {
    .contact-info {
        grid-template-columns: repeat(3, 1fr);
        margin-top: 0;
    }
}

/* Dark mode specific overrides */
.dark .contact-card {
    background: var(--card-bg);
    border-color: var(--card-border);
}

.dark .contact-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.dark .social-link {
    background: var(--bg-secondary);
    border-color: var(--card-border);
}

.dark .social-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

    /* Responsive Design */
    @media (min-width: 768px) {
        .contact-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            align-items: start;
        }
        
        .contact-info {
            margin-top: 0;
        }
    }

    /* Dark mode specific adjustments */
    .dark .form-control {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }

    .dark .form-control:focus {
        background-color: var(--bg-primary);
    }

    .dark .contact-form {
        background: var(--card-bg);
        border-color: var(--card-border);
    }

    .dark .contact-card {
        background: var(--card-bg);
        border-color: var(--card-border);
    }

    /* Ensure all text in form is readable */
    .dark .form-label,
    .dark .form-text,
    .dark .contact-card h3,
    .dark .contact-card p {
        color: var(--text-primary) !important;
    }
    /* Buttons */
    .btn {
        background-color: var(--primary-color);
        color: white;
        transition: background-color 0.3s ease;
    }

    .btn:hover {
        background-color: var(--primary-hover);
    }

    /* Modal Styles */
    .modal {
        background-color: rgba(0, 0, 0, 0.9);
    }

    .modal-content {
        background-color: var(--bg-secondary);
        color: var(--text-primary);
    }

    /* Footer */
    footer {
        color: var(--text-secondary);
    }

    /* Utility Classes for Text */
    .text-primary {
        color: var(--text-primary) !important;
    }

    .text-secondary {
        color: var(--text-secondary) !important;
    }

    .text-muted {
        color: var(--text-muted) !important;
    }

    /* Ensure all text in dark mode has good contrast */
    .dark .text-gray-300,
    .dark .text-gray-400,
    .dark .text-gray-500,
    .dark .text-gray-600,
    .dark .text-gray-700 {
        color: var(--text-secondary) !important;
    }

    /* Specific overrides for elements that need special attention */
    .dark .project-description,
    .dark .project-details p,
    .dark .experience-item p,
    .dark .card p:not(.skill-tag) {
        color: var(--text-secondary) !important;
    }

    /* Make sure links in content are visible */
    /* .dark a:not(.btn) {
        color: var(--primary-color) !important;
    } */

    .dark a:not(.btn):hover {
        color: var(--primary-hover) !important;
    }
    /* Modal Styles - Preserving Functionality */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Carousel Container */
.carousel {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-tertiary);
}

/* Image Container */
.carousel-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Navigation Buttons */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.carousel-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
    border-color: white;
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

/* Image Styling */
.carousel-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: none;
}

.carousel-image.active {
    display: block;
}

/* Image Counter */
.image-counter {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
    backdrop-filter: blur(5px);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    font-size: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
    border-color: white;
}

/* Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    z-index: 10;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.carousel-indicator.active {
    background-color: white;
    transform: scale(1.2);
    border-color: white;
}

.carousel-indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal {
        padding: 20px 10px;
    }
    
    .modal-content {
        width: 95%;
        height: auto;
        max-height: 85vh;
    }
    
    .carousel-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 10px 5px;
    }
    
    .modal-content {
        width: 98%;
        max-height: 90vh;
    }
    
    .carousel-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .carousel-indicators {
        bottom: 10px;
    }
    
    .carousel-indicator {
        width: 10px;
        height: 10px;
    }
}

/* Ensure modal is above other content */
.modal.active {
    display: flex;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

    /* Light mode: keep current */
    .demo-btn {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 1rem;
        margin: 0.25rem;
        border-radius: 0.375rem;
        font-size: 0.875rem;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.2s;
        background-color: #4f46e5;
        color: white;
        border: 1px solid transparent;
    }

    .demo-btn:hover {
        background-color: #4338ca;
        color: white;
    }
    
    /* Dark mode: stronger, darker background */
    .dark .demo-btn {
        background-color: #3730a3;      /* darker indigo */
        color: white !important;
        border-color: #4f46e5;          /* subtle border glow */
    }

    .dark .demo-btn:hover {
        background-color: #312e81;      /* even darker on hover */
        color: white !important;
    }
    
    .details-btn {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 1rem;
        margin: 0.25rem;
        border-radius: 0.375rem;
        font-size: 0.875rem;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.2s;
        background-color: #6b7280;
        color: white;
        border: 1px solid transparent;
    }
    
    .details-btn:hover {
        background-color: #4b5563;
        color: white;
    }
    
    /* Project Buttons Container */
    .project-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    /* Modal Styles */
    .details-modal {
        display: none;
        position: fixed;
        z-index: 1001;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }
    
    .details-modal-content {
        background-color: #fff;
        margin: 5% auto;
        padding: 2rem;
        border-radius: 0.5rem;
        max-width: 700px;
        position: relative;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }
    
    [data-theme="dark"] .details-modal-content {
        background-color: #1f2937;
        color: #f3f4f6;
    }
    
    .close-details-modal {
        position: absolute;
        right: 1.5rem;
        top: 1rem;
        font-size: 1.5rem;
        cursor: pointer;
        color: #6b7280;
    }
    
    .close-details-modal:hover {
        color: #4b5563;
    }
    
    [data-theme="dark"] .close-details-modal {
        color: #9ca3af;
    }
    
    [data-theme="dark"] .close-details-modal:hover {
        color: #d1d5db;
    }
    
    .features-list {
        list-style-type: disc;
        padding-left: 1.5rem;
        margin: 1rem 0;
    }
    
    .features-list li {
        margin-bottom: 0.5rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 1rem;
        color: #111827;
    }
    
    [data-theme="dark"] .modal-title {
        color: #f9fafb;
    }
    
    .modal-section {
        margin-bottom: 1.5rem;
    }
    
    .modal-section h4 {
        font-size: 1.125rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        color: #111827;
    }
    
    [data-theme="dark"] .modal-section h4 {
        color: #f3f4f6;
    }

    /* Update these styles in your existing CSS */

/* Demo Button Dark Mode Fix */
[data-theme="dark"] .demo-btn {
    background-color: #4f46e5;
    color: white !important; /* Force white text in dark mode */
}

[data-theme="dark"] .demo-btn:hover {
    background-color: #6366f1;
    color: white !important;
}

/* Details Button Dark Mode Fix */
[data-theme="dark"] .details-btn {
    background-color: #4b5563;
    color: white !important; /* Force white text in dark mode */
}

[data-theme="dark"] .details-btn:hover {
    background-color: #6b7280;
    color: white !important;
}

.dark .details-modal-content {
    background-color: #1f2937;
    color: #f3f4f6;
}

.dark .details-modal-content p,
.dark .details-modal-content li {
    color: #f3f4f6 !important; /* Ensure text is light in dark mode */
}

.dark .modal-title {
    color: #f9fafb !important;
}

.dark .modal-section h4 {
    color: #e5e7eb !important;
}

/* Ensure list items are visible in dark mode */
.dark .features-list li {
    color: #f3f4f6 !important;
}

/* Ensure proper contrast for links in dark mode */
.dark .details-modal-content a {
    color: #93c5fd;
}

.dark .details-modal-content a:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

/* Ensure the modal close button is visible in dark mode */
.dark .close-details-modal {
    color: #9ca3af;
}

.dark .close-details-modal:hover {
    color: #d1d5db;
}


/* Mobile slide-in menu theming */
#mobileMenu {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.dark #mobileMenu {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

#mobileMenu a {
    color: var(--text-secondary);
}

.dark #mobileMenu a {
    color: var(--text-secondary);
}

#mobileMenu .mobile-menu-header-text {
    color: var(--text-primary);
}


/* Project category filter buttons */
.project-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--card-border);
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.project-filter-btn:hover {
    /* background-color: var(--primary-hover); */
    /* color: #ffffff; */
    border-color: var(--primary-hover);
    transform: translateY(-2px) scale(1.03);
}

.project-filter-btn.active {
    background-color: #7c3aed; /* purple-600 */
    color: #ffffff;
    border-color: transparent;
}