/**
 * Custom CSS for Interior Portfolio
 * Zen/Japanese Style Design - Warm & Natural
 */

/* ========================
   Base Styles
   ======================== */

:root {
    --color-primary: #5D4E3C;      /* Warm wood brown */
    --color-secondary: #E8E0D5;    /* Soft cream/tatami */
    --color-accent: #A67C52;       /* Terracotta */
    --color-background: #FAF8F5;   /* Warm off-white (washi paper) */
    --color-text: #3D3D3D;         /* Warm dark gray */
    --transition-default: all 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background-color: var(--color-accent);
    color: white;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ========================
   Typography
   ======================== */

.font-serif {
    font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.font-sans {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================
   Page Transitions
   ======================== */

body {
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.page-loaded {
    opacity: 1;
}

/* ========================
   Navigation
   ======================== */

#navbar {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ========================
   Hero Section
   ======================== */

.hero-section {
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4));
    z-index: 1;
}

/* ========================
   Project Cards
   ======================== */

.project-card {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Image hover effects */
.project-card img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ========================
   Gallery Styles
   ======================== */

/* GLightbox customization */
.glightbox-clean .gslide-description {
    background: transparent;
}

.glightbox-clean .gslide-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: white;
    margin: 0;
    padding: 20px;
}

/* Before/After Slider */
.before-after-container {
    touch-action: pan-y;
    user-select: none;
}

.slider-handle {
    cursor: ew-resize;
    z-index: 10;
}

.slider-handle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Parallax images */
.parallax-container {
    overflow: hidden;
}

.parallax-image {
    will-change: transform;
}

/* ========================
   Animations
   ======================== */

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Pulse animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================
   Buttons
   ======================== */

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.875rem;
    transition: var(--transition-default);
}

.btn-primary:hover {
    background-color: rgba(44, 62, 80, 0.8);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--color-accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.875rem;
    transition: var(--transition-default);
}

.btn-accent:hover {
    background-color: rgba(201, 168, 108, 0.8);
    transform: translateY(-2px);
}

/* ========================
   Form Styles
   ======================== */

input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(201, 168, 108, 0.2);
}

/* File input styling */
input[type="file"]::file-selector-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-default);
}

input[type="file"]::file-selector-button:hover {
    background-color: rgba(44, 62, 80, 0.8);
}

/* ========================
   Scrollbar Styling
   ======================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ========================
   Admin Styles
   ======================== */

/* Drag handle cursor */
.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Sortable ghost */
.sortable-ghost {
    opacity: 0.5;
    background: var(--color-secondary);
}

/* ========================
   Loading States
   ======================== */

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* ========================
   Responsive Utilities
   ======================== */

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ========================
   Print Styles
   ======================== */

@media print {
    nav,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: none;
        color: black;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* ========================
   Accessibility
   ======================== */

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* 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 */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #000000;
        --color-accent: #0066cc;
    }
}

/* ========================
   Dark Mode Styles
   ======================== */

.dark {
    --color-primary: #E8E0D5;      /* Light cream for dark mode */
    --color-secondary: #3D3830;    /* Warm dark brown */
    --color-accent: #C9A86C;       /* Warm gold */
    --color-background: #1F1D1A;   /* Warm charcoal */
    --color-text: #E8E4E0;         /* Warm off-white */
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #2A2725;
}

.dark ::-webkit-scrollbar-thumb {
    background: #5D4E3C;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #7A6A58;
}

/* Dark mode selection */
.dark ::selection {
    background-color: var(--color-accent);
    color: #1a1a2e;
}

/* Dark mode buttons */
.dark .btn-primary {
    background-color: var(--color-accent);
    color: #1a1a2e;
}

.dark .btn-primary:hover {
    background-color: rgba(212, 184, 150, 0.8);
}

/* Dark mode project cards */
.dark .project-card {
    background-color: #252538;
}

/* Dark mode navigation */
.dark #navbar {
    background-color: rgba(26, 26, 46, 0.9);
}

/* Dark mode form inputs */
.dark input,
.dark textarea,
.dark select {
    background-color: #252538;
    border-color: #3D4F5F;
    color: #E8E8E8;
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
    box-shadow: 0 0 0 3px rgba(212, 184, 150, 0.2);
    border-color: var(--color-accent);
}

/* Dark mode file input */
.dark input[type="file"]::file-selector-button {
    background-color: var(--color-accent);
    color: #1a1a2e;
}

/* Dark mode loading skeleton */
.dark .loading-skeleton {
    background: linear-gradient(90deg, #252538 25%, #2a2a3e 50%, #252538 75%);
}

/* Dark mode cards and surfaces */
.dark .bg-white {
    background-color: #252538 !important;
}

.dark .bg-gray-50 {
    background-color: #1f1f32 !important;
}

.dark .bg-gray-100 {
    background-color: #2a2a3e !important;
}

.dark .border-gray-100,
.dark .border-gray-200,
.dark .border-gray-300 {
    border-color: #3D4F5F !important;
}

.dark .text-gray-500,
.dark .text-gray-600 {
    color: #9ca3af !important;
}

.dark .text-gray-700,
.dark .text-gray-800,
.dark .text-gray-900 {
    color: #d1d5db !important;
}

/* Dark mode hover states */
.dark .hover\:bg-gray-50:hover {
    background-color: #2a2a3e !important;
}

.dark .hover\:bg-gray-100:hover {
    background-color: #303048 !important;
}

.dark .hover\:bg-gray-200:hover {
    background-color: #3a3a52 !important;
}
