/* ========================================
   대전 성남 우미린 - Premium Styles
   Luxurious & Elegant Design System
   ======================================== */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --navy: #002060;
    --navy-dark: #001540;
    --navy-light: #003090;
    --accent: #F37021;
    --accent-dark: #D85A10;
    --accent-light: #FF8A3D;
    --gold: #C9A962;
    --gold-light: #E5D4A1;
    --white: #ffffff;
    --black: #000000;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-elegant: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-snap-type: y proximity;
    overflow-y: scroll;
    height: 100%;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    line-height: 1.7;
    color: #333;
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
}

/* Full Page Scroll Sections */
.fp-section {
    scroll-snap-align: center;
    scroll-snap-stop: always;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Allow scrollable content within sections */
.fp-section-scroll {
    scroll-snap-align: center;
    min-height: 100vh;
    overflow: visible;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 200;
    letter-spacing: -0.02em;
}

/* ========================================
   Header Styles
   ======================================== */
#header {
    background: transparent;
    transition: background 0.5s var(--transition-smooth),
                box-shadow 0.5s var(--transition-smooth);
}

#header.scrolled {
    background: rgba(0, 32, 96, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

#header .nav-link {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.3s var(--transition-smooth);
}

#header.scrolled .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

#header.scrolled .nav-link:hover {
    color: var(--accent);
}

#header #mobile-menu-btn {
    color: var(--white);
    transition: color 0.3s var(--transition-smooth);
}

#header.scrolled #mobile-menu-btn {
    color: var(--white);
}

#header .header-logo {
    filter: brightness(0) invert(1);
    transition: filter 0.3s var(--transition-smooth);
}

#header.scrolled .header-logo {
    filter: brightness(0) invert(1);
}

#header .header-cta {
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
    transition: all 0.3s var(--transition-smooth);
}

#header .header-cta:hover {
    background: var(--white);
    color: var(--navy);
}

#header.scrolled .header-cta {
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
}

#header.scrolled .header-cta:hover {
    background: var(--white);
    color: var(--navy);
}

.nav-link {
    position: relative;
}

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

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

/* Mobile Menu */
#mobile-menu {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s var(--transition-smooth),
                opacity 0.3s var(--transition-smooth);
}

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

/* ========================================
   Hero Section
   ======================================== */
#hero .hero-bg .hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile: Prioritize height coverage for portrait videos */
@media (max-width: 768px) {
    #hero {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile */
    }

    #hero .hero-bg .hero-video {
        object-position: center center;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #hero {
        min-height: 100vh;
    }

    #hero .hero-bg .hero-video {
        object-fit: cover;
        object-position: center center;
    }
}

/* Hero Text Animations */
.hero-subtitle,
.hero-title,
.hero-desc,
.hero-location {
    opacity: 0;
    transform: translateY(40px);
    animation: heroTextReveal 1s var(--transition-elegant) forwards;
}

.hero-subtitle { animation-delay: 0.3s; }
.hero-title { animation-delay: 0.5s; }
.hero-desc { animation-delay: 0.7s; }
.hero-location { animation-delay: 0.9s; }

@keyframes heroTextReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    opacity: 0;
    animation: fadeIn 1s var(--transition-smooth) 1.5s forwards;
}

.scroll-indicator > div {
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0%, 100% {
        opacity: 0.3;
        transform: scaleY(0.8);
    }
    50% {
        opacity: 1;
        transform: scaleY(1);
    }
}

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

/* ========================================
   Section Styles
   ======================================== */
.section-label {
    display: inline-block;
    position: relative;
}

.section-title {
    position: relative;
}

/* ========================================
   Scroll Reveal Animations
   ======================================== */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 0;
    transition: opacity 1s var(--transition-elegant),
                transform 1s var(--transition-elegant);
}

.reveal-up {
    transform: translateY(60px);
}

.reveal-left {
    transform: translateX(-60px);
}

.reveal-right {
    transform: translateX(60px);
}

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
    opacity: 1;
    transform: translate(0);
}

/* ========================================
   Location Tabs
   ======================================== */
.location-tab {
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: transparent;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.4s var(--transition-smooth);
}

.location-tab:hover {
    color: var(--navy);
    border-color: var(--navy);
}

.location-tab.active {
    color: var(--white);
    background: var(--navy);
    border-color: var(--navy);
}

.location-panel {
    animation: panelFade 0.6s var(--transition-elegant);
}

@media (max-width: 1024px) {
    .location-tab {
        padding: 12px 20px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .location-tab {
        padding: 10px 16px;
        font-size: 12px;
    }
}

@media (max-width: 640px) {
    .location-tab {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* ========================================
   Floor Plan Tabs
   ======================================== */
.floorplan-tab {
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: transparent;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.4s var(--transition-smooth);
}

.floorplan-tab:hover {
    color: var(--navy);
    border-color: var(--navy);
}

.floorplan-tab.active {
    color: var(--white);
    background: var(--navy);
    border-color: var(--navy);
}

.floorplan-panel {
    animation: panelFade 0.6s var(--transition-elegant);
}

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

/* ========================================
   Gallery Items
   ======================================== */
.gallery-item {
    cursor: pointer;
}

.gallery-item img {
    will-change: transform;
}

/* ========================================
   Floating Bar
   ======================================== */
.floating-btn {
    transition: width 0.4s var(--transition-elegant);
}

/* ========================================
   Form Styles
   ======================================== */
#lead-form input,
#lead-form select,
#lead-form textarea {
    font-size: 16px;
    transition: border-color 0.3s var(--transition-smooth);
}

#lead-form input:focus,
#lead-form select:focus,
#lead-form textarea:focus {
    outline: none;
}

#lead-form input::placeholder,
#lead-form textarea::placeholder {
    color: var(--gray-300);
}

/* Custom Checkbox */
#lead-form input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid var(--gray-300);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    position: relative;
}

#lead-form input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

#lead-form input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Select Arrow */
#lead-form select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 20px;
}

/* ========================================
   Button Hover Effects
   ======================================== */
button[type="submit"],
a[href="#registration"] {
    position: relative;
    overflow: hidden;
}

button[type="submit"]::before,
a[href="#registration"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s var(--transition-smooth);
}

button[type="submit"]:hover::before,
a[href="#registration"]:hover::before {
    left: 100%;
}

/* ========================================
   Loading Spinner
   ======================================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--navy);
    color: var(--white);
    padding: 16px 32px;
    font-size: 14px;
    letter-spacing: 0.02em;
    z-index: 9999;
    opacity: 0;
    transition: all 0.5s var(--transition-elegant);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #059669;
}

.toast.error {
    background: #DC2626;
}

/* ========================================
   Counter Animation
   ======================================== */
.counter-animate {
    display: inline-block;
}

/* ========================================
   Image Loading
   ======================================== */
img {
    max-width: 100%;
    height: auto;
}

img[src=""] {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    min-height: 200px;
}

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

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ========================================
   Focus States
   ======================================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========================================
   Parallax Effect (Optional)
   ======================================== */
.parallax {
    will-change: transform;
}

/* ========================================
   Info Item Hover
   ======================================== */
.info-item {
    transition: transform 0.3s var(--transition-smooth);
}

.info-item:hover {
    transform: translateX(8px);
}

/* ========================================
   Location Item
   ======================================== */
.location-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--transition-elegant),
                transform 0.6s var(--transition-elegant);
}

.location-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (max-width: 1024px) {
    .floorplan-tab {
        padding: 12px 20px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .floorplan-tab {
        padding: 10px 16px;
        font-size: 12px;
    }

    section {
        padding-top: 80px;
        padding-bottom: 80px;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }

    .floorplan-tab {
        padding: 8px 12px;
        font-size: 11px;
    }
}

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

    html {
        scroll-behavior: auto;
    }

    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }

    .hero-subtitle,
    .hero-title,
    .hero-desc,
    .hero-location {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    #header,
    #floating-bar,
    .scroll-indicator {
        display: none !important;
    }

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

    section {
        break-inside: avoid;
        padding: 20px 0;
    }
}

/* ========================================
   High Contrast Mode
   ======================================== */
@media (prefers-contrast: high) {
    :root {
        --gray-300: #666;
        --gray-400: #555;
        --gray-500: #444;
    }
}

/* ========================================
   Dark Mode Support (Future)
   ======================================== */
/*
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --black: #ffffff;
    }
}
*/

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--navy);
    color: var(--white);
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--transition-smooth);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--navy-light);
}

@media (max-width: 1024px) {
    .back-to-top {
        display: none;
    }
}

/* ========================================
   Full Page Section Layouts
   ======================================== */
.fp-section .section-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 80px;
    padding-bottom: 40px;
}

.fp-section .section-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Compact section header for full page */
.fp-section .section-header {
    margin-bottom: 32px;
    text-align: center;
}

.fp-section .section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

/* Adjust grid layouts for viewport fit */
.fp-section .fp-grid {
    display: grid;
    gap: 24px;
    align-items: center;
    height: 100%;
}

/* ========================================
   Number Count Animation
   ======================================== */
.count-up {
    font-variant-numeric: tabular-nums;
}

/* ========================================
   Elegant Line Decorations
   ======================================== */
.line-decoration {
    position: relative;
}

.line-decoration::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -40px;
    width: 30px;
    height: 1px;
    background: var(--accent);
}

/* ========================================
   Subtle Background Patterns
   ======================================== */
.pattern-dots {
    background-image: radial-gradient(circle, var(--gray-200) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ========================================
   Gradient Overlays
   ======================================== */
.gradient-overlay {
    background: linear-gradient(135deg,
        rgba(0, 32, 96, 0.9) 0%,
        rgba(0, 32, 96, 0.7) 50%,
        rgba(0, 32, 96, 0.9) 100%);
}

/* ========================================
   Image Hover Effects
   ======================================== */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.8s var(--transition-elegant);
}

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

/* ========================================
   Text Reveal Animation
   ======================================== */
.text-reveal {
    overflow: hidden;
}

.text-reveal > * {
    display: block;
    transform: translateY(100%);
    transition: transform 0.8s var(--transition-elegant);
}

.text-reveal.revealed > * {
    transform: translateY(0);
}

/* ========================================
   Stagger Animation Delays
   ======================================== */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }
