/* Custom Styles for Himalayan Pottery Studio */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Spectral', Georgia, serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: 
        linear-gradient(rgba(253, 232, 230, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(253, 232, 230, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(201, 67, 53, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(173, 116, 99, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

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

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

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

/* Typography Grounding */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

p {
    font-family: 'Spectral', Georgia, serif;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* Smooth Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Fade in sections on scroll */
.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Hero Section Enhancements */
#home h1 {
    animation: fadeInUp 1s ease-out 0.2s both;
}

#home p {
    animation: fadeInUp 1s ease-out 0.4s both;
}

#home .flex {
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Navigation Active State */
nav a.active {
    color: #c94335;
    font-weight: 600;
}

/* Form Focus States */
input:focus,
textarea:focus {
    outline: none;
}

/* Smooth Image Loading */
img {
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* Gallery Hover Effects */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.5s ease;
}

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

/* Custom Selection Colors */
::selection {
    background-color: #fbd5d1;
    color: #6f2620;
}

::-moz-selection {
    background-color: #fbd5d1;
    color: #6f2620;
}

/* Button Ripple Effect */
button,
a[class*="bg-earth"] {
    position: relative;
    overflow: hidden;
}

/* Accessibility Focus Styles */
*:focus-visible {
    outline: 2px solid #e05d4d;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav,
    footer {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(224, 93, 77, 0.3);
    border-radius: 50%;
    border-top-color: #e05d4d;
    animation: spin 0.8s linear infinite;
}

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

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(135deg, #e05d4d 0%, #c94335 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
}

/* Smooth Section Transitions */
section {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

section:nth-child(odd) {
    animation-delay: 0.1s;
}

section:nth-child(even) {
    animation-delay: 0.2s;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.show {
    max-height: 400px;
    opacity: 1;
}

/* Parallax Effect for Hero */
.parallax {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Validation States */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
}

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

/* Tooltip Styles */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #8b2e26;
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 0.5rem;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #fde8e6 25%, #fbd5d1 50%, #fde8e6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

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

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