/* Urban Treasure — Custom Styles */

/* Base reset and typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #d4541e;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Selection color */
::selection {
    background-color: #f9c99a;
    color: #5e2213;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent layout shift on all images */
img {
    object-fit: cover;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #fdf9eb;
}

::-webkit-scrollbar-thumb {
    background: #e8733a;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4541e;
}

/* 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;
    }
    
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Print styles */
@media print {
    .navbar,
    .mobile-menu,
    .geo-shape,
    .float,
    .float-slow,
    .float-sideways {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .btn-primary {
        border: 2px solid ButtonText;
    }
    
    .stat-card,
    .feature-card,
    .hero-card {
        border: 1px solid ButtonText;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .category-card:hover {
        transform: none;
    }
    
    .category-card:hover img {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* Landscape phone optimization */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    nav .max-w-7xl {
        padding: 0;
    }
}

/* Tablet breakpoint adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .w-12 {
        width: 48px;
        height: 48px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .hero-card {
        padding: 16px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
}

/* Large desktop */
@media (min-width: 1920px) {
    .max-w-7xl {
        max-width: 80rem;
    }
}

/* Subtle grain texture overlay (optional enhancement) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Active nav link highlight */
.nav-link-active {
    color: #d4541e !important;
}

/* Card hover glow effect */
.feature-card:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    box-shadow: 0 0 0 1px rgba(212, 84, 30, 0.1);
    pointer-events: none;
}

.feature-card {
    position: relative;
}

/* Loading state for buttons */
.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
}

/* Ensure all interactive elements have proper cursor */
button,
a,
input,
textarea,
select {
    cursor: pointer;
}

input[type="text"],
input[type="email"],
textarea {
    cursor: text;
}

/* Form validation styles */
.form-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #16a34a;
}

/* Skeleton loading (for future use) */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0ebe0 25%, #f5efe5 50%, #f0ebe0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
