/* Portfolio Main Styles */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --purple: #8b5cf6;
    --dark-bg: #020617;
    --dark-card: #0f172a;
    --bg: #020617;
    --bg-secondary: #0f172a;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(2, 6, 23, 0.8);
}

[data-theme="light"] {
    --bg: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #334155;
    --text-muted: #475569;
    --border: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(248, 250, 252, 0.85);
    --dark-bg: #f8fafc;
    --dark-card: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.7;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Global Typography Improvements */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
}

p, li, span, td, th {
    line-height: 1.7;
}

a {
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark-bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-15px) rotate(1deg); }
    66% { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideLeft {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes scaleInBounce {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes rotateIn {
    from { opacity: 0; transform: rotate(-10deg) scale(0.9); }
    to { opacity: 1; transform: rotate(0deg) scale(1); }
}

@keyframes flipIn {
    from { opacity: 0; transform: perspective(400px) rotateY(90deg); }
    to { opacity: 1; transform: perspective(400px) rotateY(0deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(120%); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-slide-in-right {
    animation: slide-in-right 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 50% { border-color: var(--primary); }
    51%, 100% { border-color: transparent; }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes magneticPull {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes orbit {
    from { transform: rotate(0deg) translateX(120px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(120px) rotate(-360deg); }
}

@keyframes morphBlob {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50% { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
    75% { border-radius: 60% 30% 60% 40% / 70% 40% 50% 60%; }
}

@keyframes wave {
    0%, 100% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-10px) scaleY(1.1); }
}

@keyframes glowPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.8)); }
}

/* ============================================
   ANIMATION UTILITY CLASSES
   ============================================ */

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-delayed { animation: float 6s ease-in-out 2s infinite; }
.animate-float-slow { animation: floatSlow 8s ease-in-out infinite; }
.animate-slide-up { animation: slideUp 0.6s ease-out forwards; }
.animate-slide-down { animation: slideDown 0.6s ease-out forwards; }
.animate-slide-left { animation: slideLeft 0.6s ease-out forwards; }
.animate-slide-right { animation: slideRight 0.6s ease-out forwards; }
.animate-fade-in { animation: fadeIn 0.8s ease-out forwards; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.5s ease-out forwards; }
.animate-scale-bounce { animation: scaleInBounce 0.6s ease-out forwards; }
.animate-rotate-in { animation: rotateIn 0.6s ease-out forwards; }
.animate-flip-in { animation: flipIn 0.6s ease-out forwards; }
.animate-glow-pulse { animation: glowPulse 2s ease-in-out infinite; }
.animate-morph { animation: morphBlob 8s ease-in-out infinite; }
.animate-gradient { background-size: 200% 200%; animation: gradientShift 3s ease infinite; }

/* Stagger delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate-scale.visible {
    opacity: 1;
    transform: scale(1);
}

.scroll-animate-rotate {
    opacity: 0;
    transform: rotate(-5deg) scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate-rotate.visible {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(9) { transition-delay: 0.45s; }
.stagger-children.visible > *:nth-child(10) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(11) { transition-delay: 0.55s; }
.stagger-children.visible > *:nth-child(12) { transition-delay: 0.6s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   SKILL BARS
   ============================================ */

.skill-bar {
    transition: width 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.skill-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: shimmer 2s infinite;
    background-size: 200% 100%;
}

/* ============================================
   PROJECT FILTER
   ============================================ */

.project-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    position: absolute;
    pointer-events: none;
}

.project-card.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    position: relative;
    pointer-events: auto;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   FILTER BUTTONS
   ============================================ */

.filter-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.training-filter-btn.active,
.collection-filter-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

/* ============================================
   GLASS EFFECTS
   ============================================ */

.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ============================================
   GRADIENT TEXT
   ============================================ */

.gradient-text {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-animated {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa, #6366f1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.hover-glow-purple:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-scale-sm:hover {
    transform: scale(1.02);
}

.hover-tilt {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.hover-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.hover-border-glow {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hover-border-glow:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 400px;
    height: 400px;
}

.btn-primary:active {
    transform: scale(0.95);
}

/* ============================================
   CHATBOT ANIMATIONS
   ============================================ */

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

#chatbot:not(.hidden) {
    animation: chatSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-message {
    animation: chatSlideUp 0.3s ease-out;
}

#chatbot-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

#chatbot-toggle:active {
    transform: scale(0.95);
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   NAVBAR
   ============================================ */

#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */

.card-interactive {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.card-interactive::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card-interactive:hover::before {
    opacity: 1;
}

.card-interactive:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.1);
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */

.counter {
    transition: all 0.3s ease;
}

.counter:hover {
    transform: scale(1.1);
    color: var(--primary-light);
}

/* ============================================
   BACK TO TOP
   ============================================ */

#backToTop {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#backToTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ============================================
   TIMELINE ANIMATIONS
   ============================================ */

.timeline-line {
    background: linear-gradient(to bottom, #6366f1, #8b5cf6, #6366f1);
    background-size: 100% 200%;
    animation: gradientShift 3s ease infinite;
}

.timeline-dot {
    transition: all 0.3s ease;
}

.timeline-dot:hover {
    transform: scale(1.5);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* ============================================
   PROJECT DETAIL SIDEBAR PANEL
   ============================================ */

@keyframes panelSlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes panelSlideOut {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

#projectPanelContent {
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
}

#projectPanelContent::-webkit-scrollbar {
    width: 4px;
}

#projectPanelContent::-webkit-scrollbar-track {
    background: transparent;
}

#projectPanelContent::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

#projectPanelContent::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Gallery image hover */
#panelGallery img {
    transition: transform 0.5s ease;
}

#panelGallery img:hover {
    transform: scale(1.02);
}

/* Gallery Lightbox */
#lightboxImage {
    transition: opacity 0.2s ease;
}

/* Panel Gallery Grid */
#panelGallery .aspect-\[4\/3\] {
    aspect-ratio: 4/3;
}

#lightboxThumbnails::-webkit-scrollbar {
    height: 4px;
}

#lightboxThumbnails::-webkit-scrollbar-track {
    background: transparent;
}

#lightboxThumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    #hero h1 { font-size: 2.5rem; }
    .counter { font-size: 1.5rem; }
    
    .scroll-animate {
        transform: translateY(25px);
    }
    
    .scroll-animate-left,
    .scroll-animate-right {
        transform: translateY(25px);
    }
}

/* ============================================
   PREFERS REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-animate,
    .scroll-animate-left,
    .scroll-animate-right,
    .scroll-animate-scale,
    .scroll-animate-rotate {
        opacity: 1;
        transform: none;
    }
    
    .stagger-children > * {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   THEME TOGGLE
   ============================================ */

#themeToggle {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#themeToggle:hover {
    transform: scale(1.1);
}

#themeToggle:active {
    transform: scale(0.95);
}

#themeToggle .fa-sun,
#themeToggle .fa-moon {
    transition: all 0.3s ease;
}

/* ============================================
   LIGHT THEME OVERRIDES - ENHANCED
   ============================================ */

/* --- Body & Base --- */
[data-theme="light"] body {
    background: #f1f5f9;
    color: #1e293b;
}

[data-theme="light"] ::-webkit-scrollbar-track { background: #e2e8f0; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* --- Text colors --- */
[data-theme="light"] .text-white { color: #0f172a !important; }
[data-theme="light"] .text-gray-100 { color: #0f172a !important; }
[data-theme="light"] .text-gray-200 { color: #1e293b !important; }
[data-theme="light"] .text-gray-300 { color: #334155 !important; }
[data-theme="light"] .text-gray-400 { color: #475569 !important; }
[data-theme="light"] .text-gray-500 { color: #64748b !important; }
[data-theme="light"] .text-gray-600 { color: #475569 !important; }
[data-theme="light"] .text-primary-300 { color: #4f46e5 !important; }
[data-theme="light"] .text-primary-400 { color: #4f46e5 !important; }
[data-theme="light"] .text-primary-400\/80 { color: rgba(79,70,229,0.85) !important; }
[data-theme="light"] .text-purple-400 { color: #7c3aed !important; }
[data-theme="light"] .text-cyan-400 { color: #0891b2 !important; }
[data-theme="light"] .text-emerald-400 { color: #059669 !important; }
[data-theme="light"] .text-amber-400 { color: #d97706 !important; }
[data-theme="light"] .text-rose-400 { color: #e11d48 !important; }
[data-theme="light"] .text-green-400 { color: #16a34a !important; }
[data-theme="light"] .hover\:text-white:hover { color: #0f172a !important; }
[data-theme="light"] .hover\:text-gray-300:hover { color: #1e293b !important; }
[data-theme="light"] .hover\:text-gray-400:hover { color: #334155 !important; }
[data-theme="light"] .hover\:text-primary-400:hover { color: #4338ca !important; }
[data-theme="light"] .placeholder-gray-500::placeholder { color: #94a3b8 !important; }

/* --- Backgrounds --- */
[data-theme="light"] .bg-dark-950,
[data-theme="light"] footer.bg-dark-950 { background: #f1f5f9 !important; }
[data-theme="light"] .bg-dark-900\/50 { background: rgba(255, 255, 255, 0.8) !important; }
[data-theme="light"] .bg-dark-900 { background: #ffffff !important; }
[data-theme="light"] .bg-dark-800\/50 { background: #ffffff !important; }
[data-theme="light"] .bg-dark-800\/60 { background: #ffffff !important; }
[data-theme="light"] .bg-dark-800 { background: #f1f5f9 !important; }
[data-theme="light"] .bg-white\/5 { background: rgba(0, 0, 0, 0.04) !important; }
[data-theme="light"] .bg-white\/10 { background: rgba(0, 0, 0, 0.06) !important; }
[data-theme="light"] .bg-white\/\[0\.03\] { background: #ffffff !important; }
[data-theme="light"] .bg-white\/\[0\.02\] { background: rgba(255,255,255,0.9) !important; }
[data-theme="light"] .bg-black\/60 { background: rgba(0, 0, 0, 0.4) !important; }
[data-theme="light"] .bg-black\/50 { background: rgba(0, 0, 0, 0.35) !important; }
[data-theme="light"] .bg-black\/40 { background: rgba(0, 0, 0, 0.25) !important; }
[data-theme="light"] .bg-green-500\/10 { background: rgba(34, 197, 94, 0.1) !important; }
[data-theme="light"] .bg-amber-500\/10 { background: rgba(245, 158, 11, 0.1) !important; }

/* --- Borders --- */
[data-theme="light"] .border-white\/5 { border-color: rgba(0, 0, 0, 0.1) !important; }
[data-theme="light"] .border-white\/10 { border-color: rgba(0, 0, 0, 0.15) !important; }
[data-theme="light"] .border-white\/\[0\.06\] { border-color: rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] .border-white\/\[0\.08\] { border-color: rgba(0, 0, 0, 0.1) !important; }
[data-theme="light"] .border-t\/5,
[data-theme="light"] .border-t { border-color: rgba(0, 0, 0, 0.1) !important; }
[data-theme="light"] .border-primary-500\/15 { border-color: rgba(99, 102, 241, 0.2) !important; }
[data-theme="light"] .border-primary-500\/20 { border-color: rgba(99, 102, 241, 0.25) !important; }
[data-theme="light"] .border-primary-500\/30 { border-color: rgba(99, 102, 241, 0.3) !important; }
[data-theme="light"] .border-green-500\/30 { border-color: rgba(34, 197, 94, 0.3) !important; }

/* --- Navbar --- */
[data-theme="light"] #navbar {
    background: rgba(241, 245, 249, 0.92) !important;
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(12px);
}
[data-theme="light"] #navbar.scrolled {
    background: rgba(241, 245, 249, 0.97) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] #navbar .text-gray-400 { color: #475569 !important; }
[data-theme="light"] #navbar .text-gray-400:hover { color: #0f172a !important; }
[data-theme="light"] #navbar .text-white { color: #0f172a !important; }

/* --- Mobile Menu --- */
[data-theme="light"] #mobileMenu {
    background: #ffffff !important;
    border-top-color: rgba(0, 0, 0, 0.1) !important;
}
[data-theme="light"] #mobileMenu a { color: #475569 !important; }
[data-theme="light"] #mobileMenu a:hover { color: #0f172a !important; }

/* --- Sections --- */
[data-theme="light"] #skills,
[data-theme="light"] #education,
[data-theme="light"] #experience,
[data-theme="light"] #services,
[data-theme="light"] #testimonials,
[data-theme="light"] #collections,
[data-theme="light"] #blog {
    background: #ffffff !important;
}
[data-theme="light"] section h2 { color: #0f172a !important; }
[data-theme="light"] section span.uppercase { color: #6366f1 !important; }
[data-theme="light"] section .w-12.h-0\.5 { background: linear-gradient(to right, #6366f1, #8b5cf6) !important; }

/* --- Hero background blobs --- */
[data-theme="light"] #hero { background: #f1f5f9 !important; }
[data-theme="light"] #hero .bg-primary-500\/10 { background: rgba(99, 102, 241, 0.08) !important; }
[data-theme="light"] #hero .bg-purple-500\/10 { background: rgba(139, 92, 246, 0.08) !important; }
[data-theme="light"] #hero .bg-primary-500\/5 { background: rgba(99, 102, 241, 0.04) !important; }

/* --- Hero Profile Wrap --- */
[data-theme="light"] #heroProfileWrap .bg-dark-900\/90,
[data-theme="light"] #heroProfileWrap .bg-dark-900\/95 {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}
[data-theme="light"] #heroProfileWrap .text-white { color: #1e293b !important; }
[data-theme="light"] #heroProfileWrap .text-gray-500 { color: #64748b !important; }
[data-theme="light"] #heroProfileWrap .bg-dark-800 {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* --- Gradient text --- */
[data-theme="light"] .gradient-text-animated {
    background: linear-gradient(135deg, #4f46e5, #7c3aed, #6d28d9, #4f46e5);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

/* --- Cards (experience, education, projects, etc.) --- */
[data-theme="light"] .card-interactive {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] .hover-border-glow:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .card-interactive:hover {
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .hover-lift:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* --- Filter buttons --- */
[data-theme="light"] .filter-btn {
    border-color: rgba(0, 0, 0, 0.1);
    color: #64748b;
}
[data-theme="light"] .filter-btn:hover {
    border-color: rgba(99, 102, 241, 0.3);
    color: #4f46e5;
}
[data-theme="light"] .filter-btn.active {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .training-filter-btn.active,
[data-theme="light"] .collection-filter-btn.active {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border-color: rgba(99, 102, 241, 0.3);
}

/* --- Contact form inputs --- */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] textarea {
    background: #f8fafc !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #1e293b !important;
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: #94a3b8 !important;
}
[data-theme="light"] .focus\:border-primary-500:focus {
    border-color: #6366f1 !important;
}

/* --- Labels --- */
[data-theme="light"] label.text-gray-400 { color: #64748b !important; }

/* --- Back to top --- */
[data-theme="light"] #backToTop {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #64748b !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] #backToTop:hover {
    color: #4f46e5 !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

/* --- Theme toggle button --- */
[data-theme="light"] #themeToggle {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #64748b !important;
}
[data-theme="light"] #themeToggle:hover {
    color: #4f46e5 !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

/* --- Timeline --- */
[data-theme="light"] .timeline-line {
    background: linear-gradient(to bottom, #6366f1, #8b5cf6, #6366f1);
}

/* --- Project panel --- */
[data-theme="light"] #projectPanelContent {
    background: linear-gradient(to bottom, #ffffff, #f8fafc) !important;
    border-left-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: -12px 0 50px rgba(0, 0, 0, 0.15) !important;
}
[data-theme="light"] #projectPanelContent .sticky { background: rgba(255, 255, 255, 0.97) !important; }
[data-theme="light"] #projectPanelContent .bg-white\/\[0\.03\] { background: #f8fafc !important; border-color: rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] #projectPanelContent .bg-white\/5 { background: #ffffff !important; border-color: rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] #projectPanelContent .text-white { color: #0f172a !important; }
[data-theme="light"] #projectPanelContent .text-gray-300 { color: #475569 !important; }
[data-theme="light"] #projectPanelContent .text-gray-300\/90 { color: #475569 !important; }
[data-theme="light"] #projectPanelContent .text-gray-400 { color: #64748b !important; }
[data-theme="light"] #projectPanelContent .text-gray-500 { color: #64748b !important; }
[data-theme="light"] #projectPanelContent .text-gray-600 { color: #94a3b8 !important; }
[data-theme="light"] #projectPanelContent .border-white\/10 { border-color: rgba(0, 0, 0, 0.1) !important; }
[data-theme="light"] #projectPanelContent .border-white\/\[0\.06\] { border-color: rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] #projectPanelContent .border-white\/5 { border-color: rgba(0, 0, 0, 0.08) !important; }

/* --- Project panel gallery placeholder --- */
[data-theme="light"] #panelPlaceholder .bg-gradient-to-br { background: rgba(99, 102, 241, 0.06) !important; }

/* --- Gallery grid in panel --- */
[data-theme="light"] #panelGallery .border-white\/5 { border-color: rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] #panelGallery .text-gray-400 { color: #6b7280 !important; }
[data-theme="light"] #panelGallery .text-gray-500 { color: #9ca3af !important; }

/* ============================================
   CHATBOT ENHANCED
   ============================================ */

#chatbot-toggle {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(99, 102, 241, 0.15);
    animation: chatBounce 2s ease-in-out infinite;
}

@keyframes chatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

#chatbot {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

#chatbot .bg-gradient-to-r.from-primary-500 {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa) !important;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

[data-theme="light"] #chatbot {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] #chatMessages .bg-white\/5 {
    background: #f1f5f9 !important;
}

[data-theme="light"] #chatMessages .text-gray-300 {
    color: #475569 !important;
}

[data-theme="light"] #chatMessages .bg-primary-500\/20 {
    background: rgba(99, 102, 241, 0.1) !important;
}

[data-theme="light"] #chatMessages .bg-primary-500\/20 .text-white {
    color: #1e293b !important;
}

[data-theme="light"] #chatInput {
    background: #f8fafc !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #1e293b !important;
}

[data-theme="light"] #chatInput::placeholder {
    color: #94a3b8 !important;
}

[data-theme="light"] #chatMessages .w-8.h-8.rounded-full.bg-primary-500\/20 {
    background: rgba(99, 102, 241, 0.12) !important;
}

/* ============================================
   FOOTER
   ============================================ */

[data-theme="light"] footer {
    background: #e2e8f0 !important;
    border-top-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] footer .text-gray-500 { color: #475569 !important; }
[data-theme="light"] footer .text-white { color: #0f172a !important; }
[data-theme="light"] footer .hover\:text-primary-400:hover { color: #4338ca !important; }

/* --- Gradient overlays from-dark-800 --- */
[data-theme="light"] .from-dark-800 { --tw-gradient-from: #f1f5f9 !important; }

/* --- Section divider line --- */
[data-theme="light"] .border-t.border-white\/5 { border-color: rgba(0, 0, 0, 0.06) !important; }

/* --- Chatbot toggle for light theme --- */
[data-theme="light"] #chatbot-toggle {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35), 0 0 40px rgba(99, 102, 241, 0.12);
}
[data-theme="light"] #chatbot-toggle .text-white { color: #ffffff !important; }
[data-theme="light"] #chatbot-toggle .border-white { border-color: rgba(255,255,255,0.4) !important; }

/* --- Stagger children visible state --- */
[data-theme="light"] .stagger-children.visible > * { opacity: 1; transform: translateY(0); }

/* --- Hero stats labels --- */
[data-theme="light"] #hero .text-gray-500 { color: #64748b !important; }



/* --- Glass --- */
[data-theme="light"] .glass {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
}

/* --- About section cards & social links --- */
[data-theme="light"] .bg-white\/\[0\.03\] { background: #ffffff !important; }
[data-theme="light"] .border-white\/\[0\.06\] { border-color: rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] .bg-primary-500\/10 { background: rgba(99, 102, 241, 0.1) !important; }
[data-theme="light"] .bg-primary-500\/5 { background: rgba(99, 102, 241, 0.05) !important; }
[data-theme="light"] .bg-primary-500\/\[0\.15\] { background: rgba(99, 102, 241, 0.1) !important; }
[data-theme="light"] .hover\:bg-primary-500\/5:hover { background: rgba(99, 102, 241, 0.08) !important; }
[data-theme="light"] .hover\:bg-primary-500\/10:hover { background: rgba(99, 102, 241, 0.12) !important; }
[data-theme="light"] .shadow-primary-500\/5 { --tw-shadow-color: rgba(99, 102, 241, 0.08); }
[data-theme="light"] .shadow-primary-500\/20 { --tw-shadow-color: rgba(99, 102, 241, 0.15); }
[data-theme="light"] .skill-bar { background: rgba(99, 102, 241, 0.15); }

/* ============================================
   PROJECTS SECTION - LIGHT THEME
   ============================================ */
[data-theme="light"] .project-card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] .project-card:hover {
    border-color: rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.12) !important;
}
[data-theme="light"] .project-card .bg-dark-800\/60 { background: #ffffff !important; }
[data-theme="light"] .project-card .text-white { color: #0f172a !important; }
[data-theme="light"] .project-card .text-gray-500 { color: #64748b !important; }
[data-theme="light"] .project-card .text-gray-600 { color: #94a3b8 !important; }
[data-theme="light"] .project-card .border-white\/\[0\.06\] { border-color: rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] .project-card .border-t { border-color: rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] .project-card .bg-white\/5 { background: rgba(0, 0, 0, 0.04) !important; }
[data-theme="light"] .project-card .text-gray-400 { color: #64748b !important; }
[data-theme="light"] .project-card .bg-primary-500\/10 { background: rgba(99, 102, 241, 0.1) !important; }
[data-theme="light"] .project-card .text-primary-400 { color: #4f46e5 !important; }
[data-theme="light"] .project-card .text-primary-400\/80 { color: rgba(79, 70, 229, 0.85) !important; }
[data-theme="light"] .project-card .hover\:text-primary-300:hover { color: #4338ca !important; }

/* Image gradient overlay */
[data-theme="light"] .project-card .from-dark-800 { --tw-gradient-from: rgba(255,255,255,0.85) !important; }
[data-theme="light"] .project-card .via-dark-800\/30 { --tw-gradient-via: rgba(255,255,255,0.3) !important; }

/* Gallery count badge - keep readable */
[data-theme="light"] .project-card .bg-black\/60 { background: rgba(0,0,0,0.55) !important; }

/* Section heading */
[data-theme="light"] #projects .text-white { color: #0f172a !important; }

/* ============================================
   SKILLS SECTION - LIGHT THEME
   ============================================ */

/* Progress bar track - interactive color on light */
[data-theme="light"] #skills .bg-white\/5 {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12)) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

/* Skill card background */
[data-theme="light"] #skills .bg-dark-800\/50 {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Skill card border */
[data-theme="light"] #skills .border-white\/5 {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Skill name text */
[data-theme="light"] #skills .text-white {
    color: #1e293b !important;
}

/* Skill description text */
[data-theme="light"] #skills .text-gray-500 {
    color: #64748b !important;
}

/* ============================================
   TRAININGS SECTION - LIGHT THEME
   ============================================ */

/* Training section heading */
[data-theme="light"] #trainings .text-white {
    color: #1e293b !important;
}

/* Training card background */
[data-theme="light"] #trainings .bg-white\/\[0\.02\] {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Training card border */
[data-theme="light"] #trainings .border-white\/\[0\.06\] {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Training hover gradient overlay */
[data-theme="light"] #trainings .from-black\/50 {
    --tw-gradient-from: rgba(0, 0, 0, 0.4) !important;
}

/* Training hover title text */
[data-theme="light"] #trainings .text-white.font-medium {
    color: #ffffff !important;
}

/* Training expand icon */
[data-theme="light"] #trainings .bg-black\/40 {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* ============================================
   CONTACT SUCCESS TOAST - LIGHT THEME
   ============================================ */

[data-theme="light"] #contactToast {
    background: linear-gradient(135deg, rgba(220, 252, 231, 0.95), rgba(209, 250, 229, 0.95)) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
    box-shadow: 0 20px 60px rgba(34, 197, 94, 0.15) !important;
    color: #166534 !important;
}

[data-theme="light"] #contactToast .w-8 {
    background: rgba(34, 197, 94, 0.2) !important;
}

[data-theme="light"] #contactToast .fa-check {
    color: #16a34a !important;
}

[data-theme="light"] #contactToast button {
    color: rgba(22, 101, 52, 0.5) !important;
}

[data-theme="light"] #contactToast button:hover {
    color: #166534 !important;
}

/* ============================================
   LIGHTBOX / IMAGE VIEWER - KEEP DARK IN LIGHT THEME
   ============================================ */

/* Training, Collection & Gallery lightbox backdrops */
[data-theme="light"] #trainingLightbox,
[data-theme="light"] #collectionLightbox,
[data-theme="light"] #galleryLightbox {
    background: rgba(0, 0, 0, 0.92) !important;
}

[data-theme="light"] #trainingLightbox > div,
[data-theme="light"] #collectionLightbox > div,
[data-theme="light"] #galleryLightbox > div {
    background: transparent !important;
}

/* Lightbox buttons - keep white on dark */
[data-theme="light"] #trainingLightbox button,
[data-theme="light"] #collectionLightbox button,
[data-theme="light"] #galleryLightbox button {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: transparent !important;
}

[data-theme="light"] #trainingLightbox button:hover,
[data-theme="light"] #collectionLightbox button:hover,
[data-theme="light"] #galleryLightbox button:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* Lightbox counter text */
[data-theme="light"] #trainingCounter,
[data-theme="light"] #trainingTitle,
[data-theme="light"] #lightboxCounter,
[data-theme="light"] #collectionCounter,
[data-theme="light"] #collectionTitle {
    color: #ffffff !important;
}
[data-theme="light"] #collectionTitle,
[data-theme="light"] #trainingTitle {
    color: #cbd5e1 !important;
}

/* Lightbox backdrop overlays */
[data-theme="light"] #trainingLightbox .absolute.inset-0,
[data-theme="light"] #collectionLightbox .absolute.inset-0,
[data-theme="light"] #galleryLightbox .absolute.inset-0 {
    background: rgba(0, 0, 0, 0.9) !important;
}

/* Lightbox thumbnail borders */
[data-theme="light"] #lightboxThumbnails button {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="light"] #lightboxThumbnails button.border-primary-400,
[data-theme="light"] #lightboxThumbnails button[class*="border-primary"] {
    border-color: #818cf8 !important;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */

/* Section headings responsive */
section h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

@media (min-width: 640px) {
    section h2 {
        font-size: 1.875rem;
    }
}

@media (min-width: 1024px) {
    section h2 {
        font-size: 2.25rem;
    }
}

/* Body text improvements */
.text-sm {
    font-size: 0.875rem;
    line-height: 1.6;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1.5;
}

/* Section label typography */
section span.uppercase {
    letter-spacing: 0.2em;
    font-weight: 600;
}

/* Smooth font rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Mobile First: 0 - 640px */
@media (max-width: 639px) {
    /* Reduce padding on mobile */
    .px-6 { padding-left: 1rem; padding-right: 1rem; }
    .py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
    .p-6 { padding: 1rem; }
    
    /* Stack grids on mobile */
    .grid-cols-2 { grid-template-columns: 1fr; }
    .grid-cols-3 { grid-template-columns: 1fr; }
    .grid-cols-4 { grid-template-columns: 1fr 1fr; }
    
    /* Fix contact form */
    form .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    /* Reduce hero heading */
    #hero h1 { font-size: 2rem; letter-spacing: -0.02em; }
    
    /* Counter section */
    .counter { font-size: 1.25rem; }
    
    /* Lightbox thumbnails hide on very small screens */
    #lightboxThumbnails { display: none; }
    
    /* Chatbot full width on mobile */
    #chatbot {
        width: calc(100vw - 1rem) !important;
        right: 0.5rem !important;
        bottom: 5rem !important;
    }
}

/* Medium screens: 768px+ */
@media (min-width: 768px) {
    /* Restore grid layouts */
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Large screens: 1024px+ */
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Extra large screens: 1280px+ */
@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* ============================================
   DASHBOARD RESPONSIVE
   ============================================ */

/* Dashboard table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-radius: 1rem;
}

.table-responsive::-webkit-scrollbar {
    height: 4px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

@media (max-width: 768px) {
    /* Dashboard sidebar mobile */
    .sidebar-open {
        transform: translateX(0) !important;
    }
    
    /* Stack stat cards on mobile */
    .stat-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* Reduce padding in dashboard */
    .dashboard-content {
        padding: 1rem;
    }
    
    /* Modal full width on mobile */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0.5rem;
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    /* Single column stat cards on very small screens */
    .stat-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Full width buttons on mobile */
    .btn-full-mobile {
        width: 100%;
    }
}

/* ============================================
   ACCESSIBILITY & READABILITY
   ============================================ */

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text: #ffffff;
        --text-secondary: #e2e8f0;
        --text-muted: #cbd5e1;
        --border: rgba(255, 255, 255, 0.3);
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none !important;
    }
}
