/* css/styles.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Enhanced Dark Mode Support */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

body.app-loading {
    visibility: hidden;
    overflow: hidden;
}

body.app-ready {
    visibility: visible;
}

#navigation-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

/* Ensure smooth transitions for all theme-able properties */
* {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Dark mode as default */
:root {
    color-scheme: dark;
    --nav-height: 73px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.light ::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.light ::-webkit-scrollbar-thumb {
    background: #d1d5db;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Additional utility classes for theme transitions */
.theme-transition {
    transition: all 0.3s ease;
}

/* Ensure backdrop blur works in light mode */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

.backdrop-blur-xl {
    backdrop-filter: blur(24px);
}

/* Fix for gradient text in light mode */
.text-transparent {
    color: transparent;
}

/* Ensure proper contrast in both themes */
.dark .bg-gray-900\/60 {
    background-color: rgba(17, 24, 39, 0.6);
}

.light .bg-gray-900\/60 {
    background-color: rgba(243, 244, 246, 0.6);
}

/* Smooth hover effects */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Focus styles for accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Go to Top Button Styles */
#go-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

#go-to-top.visible {
    opacity: 1;
    transform: scale(1);
}

#go-to-top:hover {
    transform: scale(1.1);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Animation utilities */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation animations */
.nav-link {
    animation: fadeInUp 0.6s ease-out both;
}

/* Fix for navbar overlap on all sections */
section {
    scroll-margin-top: 80px;
}

/* Ensure proper spacing for mobile */
@media (max-width: 850px) {
    section {
        scroll-margin-top: 100px;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .break-after-page {
        page-break-after: always;
    }
}

/* Ensure proper spacing for all sections */
section.min-h-screen:not(:first-of-type) {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

body.menu-open {
    overflow: hidden;
}


/* ===== MOBILE NAVIGATION ===== */
#site-nav {
    overflow: visible;
    width: 100%;
    max-width: 100vw;
}

#mobile-menu {
    width: 100%;
    max-width: 100vw;
    max-height: calc(100dvh - var(--nav-height));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#mobile-menu:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
}

#mobile-menu-overlay {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    top: var(--nav-height);
    opacity: 0;
    transition: opacity 0.2s ease;
}

#mobile-menu-overlay:not(.hidden) {
    opacity: 1;
}

.light #mobile-menu {
    background-color: #ffffff !important;
    border-color: #e5e7eb;
}

.light #mobile-menu a {
    color: #1f2937;
}

.light #mobile-menu a:hover {
    background-color: #f3f4f6;
    color: #111827;
}
