/* Dark theme overrides & layout */
:root {
    --bg: #0f0f10;
    --panel: #111214;
    --text: #eaeaea;
    --muted: #a1a1aa;
    --accent: #facc15;
}

html, body { 
    height: 100%; 
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Roboto Mono', monospace;
}

h1, h2, h3 { 
    font-family: 'Bebas Neue', sans-serif; 
    letter-spacing: 1px; 
}

.section-title { 
    font-size: clamp(1.75rem, 1.1rem + 2.2vw, 2.5rem); 
    font-weight: 800; 
}

/* Neo overrides to suit dark */
.neo-brutalist {
    border: 4px solid #000;
    border-radius: 6px;
    box-shadow: 8px 8px 0 #000;
    transition: all 0.2s ease;
}

.neo-brutalist:hover {
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 #000;
}

/* Music toggle specific styling */
#music-toggle .neo-brutalist {
    border: 2px solid #ffffff; /* white */
}

#music-toggle .neo-brutalist:hover {
    transform: translate(2px, 2px);
}

/* Music toggle active state (when playing) */
#music-toggle input:checked + label .neo-brutalist {
    background-color: #facc15 !important; /* yellow-400 */
}

#music-toggle input:checked + label .neo-brutalist span {
    background-color: #374151 !important; /* gray-700 */
}

/* Sticky header */
#main-header {
    position: fixed;
    top: -20px;
    z-index: 1000;
    background: transparent;
    transition: all 0.8s ease-out;
    transform: translateY(-20px);
    opacity: 0;
}

#main-header nav {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}



/* Portfolio Images */
.work-thumb {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16/9;
}

.work-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: block;
    opacity: 1;
    flex-shrink: 0;
}

.work-thumb img:hover {
    transform: scale(1.05);
}

.fallback-thumb {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ensure images are visible */
.work-thumb img[src] {
    opacity: 1;
}

.work-thumb img[src]:not([src=""]) {
    opacity: 1;
}

/* Force image visibility */
.work-thumb img {
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
    max-width: none !important;
    max-height: none !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1 !important;
}

/* Ensure fallback is visible when image fails */
.work-thumb .fallback-thumb {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
}

/* Ensure proper image sizing */
.work-thumb {
    min-height: 12rem; /* 48 * 0.25rem = 12rem */
    background: #1f2937; /* fallback background */
    position: relative;
    overflow: hidden;
}

/* Portfolio grid transitions */
#portfolio-grid {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Mobile filter dropdown styling */
#mobile-filter-dropdown {
    min-width: 200px;
    flex-shrink: 0;
}

/* Ensure proper alignment with section title */
#portfolio .flex {
    align-items: center;
    gap: 1rem;
}

#portfolio .section-title {
    flex-shrink: 0;
    margin: 0;
}

/* Mobile-specific adjustments */
@media (max-width: 640px) {
    #portfolio .flex {
        gap: 0.75rem;
    }
    
    #portfolio .section-title {
        font-size: 1.75rem; /* Slightly smaller on mobile */
    }
    
    #mobile-filter-dropdown button {
        padding: 0.5rem 1rem; /* Smaller padding on mobile */
        font-size: 0.875rem; /* Smaller font on mobile */
    }
}

/* Ensure consistent spacing and typography */
#mobile-filter-dropdown button {
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0.025em;
}

#mobile-filter-dropdown div button {
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0.025em;
}

/* Fallback dropdown styling */
#fallback-dropdown-toggle {
    transition: all 0.2s ease;
    background-color: #fbbf24 !important; /* yellow-400 */
    color: #000 !important; /* black */
    border: 4px solid #000;
}

#fallback-dropdown-toggle:hover {
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 #000;
}

#fallback-dropdown-menu {
    box-shadow: 8px 8px 0 #000;
    background-color: #000 !important; /* black */
    color: #fff !important; /* white */
}

.fallback-dropdown-option {
    transition: background-color 0.2s ease;
    background-color: #000 !important; /* black */
    color: #fff !important; /* white */
    border-bottom: 2px solid #374151; /* gray-700 */
}

.fallback-dropdown-option:hover {
    background-color: #111214 !important; /* dark gray */
}

.fallback-dropdown-option:last-child {
    border-bottom: none;
}

/* Simple dropdown styling */
#simple-dropdown-btn {
    transition: all 0.2s ease;
    background-color: #fbbf24 !important; /* yellow-400 */
    color: #000 !important; /* black */
    border: 4px solid #000;
}

#simple-dropdown-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 #000;
}

#simple-dropdown-list {
    box-shadow: 8px 8px 0 #000;
    background-color: #000 !important; /* black */
    color: #fff !important; /* white */
}

.simple-option {
    transition: background-color 0.2s ease;
    background-color: #000 !important; /* black */
    color: #fff !important; /* white */
    border-bottom: 2px solid #374151; /* gray-700 */
}

.simple-option:hover {
    background-color: #111214 !important; /* dark gray */
}

.simple-option:last-child {
    border-bottom: none;
}

#mobile-filter-dropdown .neo-brutalist {
    border: 4px solid #000;
    border-radius: 6px;
    box-shadow: 8px 8px 0 #000;
    transition: all 0.2s ease;
}

#mobile-filter-dropdown button {
    width: 100%;
    text-align: left;
    justify-content: space-between;
    background-color: #fbbf24 !important; /* yellow-400 */
    color: #000 !important; /* black */
    font-weight: 700;
    padding: 0.75rem 1rem;
}

#mobile-filter-dropdown button:hover {
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 #000;
}

#mobile-filter-dropdown div {
    z-index: 10;
    min-width: 200px;
    background-color: #000 !important; /* black */
    color: #fff !important; /* white */
}

#mobile-filter-dropdown div button {
    background-color: #000 !important; /* black */
    color: #fff !important; /* white */
    border-bottom: 2px solid #374151; /* gray-700 */
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

#mobile-filter-dropdown div button:hover {
    background-color: #111214 !important; /* dark gray */
    transform: none;
    box-shadow: none;
}

#mobile-filter-dropdown div button:last-child {
    border-bottom: none;
}

/* Override vendor dropdown default styles */
#mobile-filter-dropdown .neo-brutalist.bg-white {
    background-color: #000 !important;
    color: #fff !important;
}

#mobile-filter-dropdown .neo-brutalist.bg-white button {
    background-color: #000 !important;
    color: #fff !important;
}

#mobile-filter-dropdown .neo-brutalist.bg-white button:hover {
    background-color: #111214 !important;
}

/* Additional styling for consistency */
#mobile-filter-dropdown .neo-brutalist {
    border-radius: 0; /* Remove border radius for sharp edges like main menu */
}

#mobile-filter-dropdown div {
    border-radius: 0; /* Remove border radius for dropdown menu */
}

/* Ensure proper contrast and readability */
#mobile-filter-dropdown button,
#mobile-filter-dropdown div button {
    text-shadow: none; /* Remove any text shadows */
    font-weight: 600; /* Slightly lighter than main menu for better hierarchy */
}

.work-thumb img {
    min-height: 100%;
    min-width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Modal image styling */
#modal-content .work-thumb {
    width: 100%;
    aspect-ratio: 16/9;
}

/* Custom scrollbar for modal content */
#modal-content::-webkit-scrollbar {
    width: 8px;
}

#modal-content::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

#modal-content::-webkit-scrollbar-thumb {
    background: #facc15;
    border-radius: 4px;
    border: 2px solid #1f2937;
}

#modal-content::-webkit-scrollbar-thumb:hover {
    background: #fbbf24;
}

/* Firefox scrollbar styling */
#modal-content {
    scrollbar-width: thin;
    scrollbar-color: #facc15 #1f2937;
}

/* Custom scrollbar for main page */
html::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

html::-webkit-scrollbar-thumb {
    background: #facc15;
    border-radius: 4px;
    border: 2px solid #1f2937;
}

html::-webkit-scrollbar-thumb:hover {
    background: #fbbf24;
}

/* Firefox scrollbar styling for main page */
html {
    scrollbar-width: thin;
    scrollbar-color: #facc15 #1f2937;
}

#modal-content .work-thumb img {
    min-height: 100%;
    min-width: 100%;
}

/* Loading indicator */
.loading-indicator {
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
}

/* Portfolio Filters */
.portfolio-filters {
    margin-bottom: 2rem;
}

.filter-btn {
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.filter-btn.active {
    background-color: #fbbf24 !important; /* yellow-400 */
    color: #000 !important;
    border-color: #fbbf24 !important;
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 #000;
}

.filter-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 #000;
}

/* Filter button hover state - change text, border, and background when not active */
.filter-btn:not(.active):hover {
    color: #000 !important; /* black */
    border-color: #000 !important; /* black */
    background-color: #ffffff !important; /* white */
}

.filter-btn.active:hover {
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 #000;
}

/* Filter button responsive design */
@media (max-width: 768px) {
    .portfolio-filters .flex {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Portfolio section responsive layout */
@media (max-width: 640px) {
    #portfolio .flex {
        gap: 0.5rem;
    }
    
    #mobile-filter-dropdown {
        min-width: 150px;
    }
}

/* Skip link for a11y */
.skip-link {
    position: absolute; 
    left: -9999px; 
    top: auto; 
    width: 1px; 
    height: 1px; 
    overflow: hidden;
}

.skip-link:focus {
    left: 1rem; 
    top: 1rem; 
    width: auto; 
    height: auto; 
    padding: .5rem .75rem; 
    background: #000; 
    color: #fff;
    z-index: 9999;
    border-radius: 4px;
}

/* Cards hover */
.work-card { 
    transition: transform .15s ease, box-shadow .15s ease; 
}

.work-card:hover { 
    transform: translate(2px, 2px); 
    box-shadow: 6px 6px 0 #000; 
}

/* Badge styling (copied from neo Badge with site tweaks) */
.badge.neo-brutalist {
    border-width: 4px;
    border-color: #000;
    box-shadow: 8px 8px 0 #000;
    margin-left: -4px; /* Move badge 3px left */
}
.badge.neo-brutalist:hover {
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 #000;
}

.work-thumb { 
    background-image: linear-gradient(135deg, #1b1b1d 0%, #1f1f22 100%); 
}

/* Hero */
.hero { 
    background: var(--panel); 
}

/* Form styles */
input, textarea {
    font-family: 'Roboto Mono', monospace;
}

input:focus, textarea:focus {
    transition: border-color 0.2s ease;
}

/* Responsive tweaks */
@media (max-width: 640px) {
    #main-header {
        top: -8px; /* Move nav 6px down from -20px to -14px on mobile */
    }
    
    nav ul li a { 
        padding: .25rem 0; 
        display: inline-block; 
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Animation classes */
.will-reveal { 
    opacity: 0; 
    transform: translateY(12px); 
    transition: opacity .5s ease, transform .5s ease; 
}

.reveal { 
    opacity: 1; 
    transform: translateY(0); 
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Reduced font sizes for neo-brutalist bg-black p-3 text-center elements */
.neo-brutalist.bg-black.p-3.text-center {
    font-size: 16px;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Screen Styles */
#loading-screen {
    backdrop-filter: blur(10px);
}

/* Music Alert Popup - Initially Hidden */
#music-alert.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Music Alert Popup - Smooth Appearance */
#music-alert {
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

#loading-screen img {
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.3));
}

/* Page Loaded State - Smooth transition for header */
#main-header {
    transition: all 0.8s ease-out;
}

/* Loading Animations - Removed conflicting animations */
/* The existing will-reveal/reveal system will handle element animations */

/* Anchor Point Adjustments - Move sections 80px up when navigating */
#about, #skills, #experience, #education, #portfolio {
    scroll-margin-top: 80px;
}