/**
 * responsive.css - 반응형 스타일시트
 * 이서영 총영사 공식 웹사이트
 * 모바일 퍼스트 + 태블릿/데스크탑 브레이크포인트
 * 위치: /assets/css/responsive.css
 */

/* ========== BREAKPOINT DEFINITIONS ========== */
/*
 * Mobile First Approach
 * Base styles: 0 - 479px (Extra Small Mobile)
 * sm: 480px - 639px (Mobile)
 * md: 640px - 767px (Large Mobile / Small Tablet)
 * lg: 768px - 1023px (Tablet)
 * xl: 1024px - 1279px (Large Tablet / Small Desktop)
 * 2xl: 1280px+ (Desktop)
 */

/* ========== BASE MOBILE STYLES (0 - 479px) ========== */
/* These are the default styles in style.css */

/* Extra Small Mobile Adjustments */
@media screen and (max-width: 359px) {
    :root {
        --font-size-base: 0.875rem;
        --spacing-md: 0.75rem;
        --header-height: 50px;
        --bottom-nav-height: 56px;
    }

    .header-title {
        font-size: var(--font-size-base);
    }

    .profile-section .profile-name {
        font-size: var(--font-size-xl);
    }

    .profile-section .profile-stats {
        gap: var(--spacing-lg);
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bottom-nav-item span {
        font-size: 10px;
    }

    .drawer-content {
        width: 250px;
    }
}

/* ========== SMALL MOBILE (480px - 639px) ========== */
@media screen and (min-width: 480px) {
    .hero-slider {
        height: 350px;
    }

    .slider-title {
        font-size: var(--font-size-3xl);
    }

    .profile-image-container {
        width: 140px;
        height: 140px;
    }

    .stat-grid {
        gap: var(--spacing-lg);
    }

    .card-content {
        padding: var(--spacing-lg);
    }

    .timeline-item {
        padding: var(--spacing-lg);
    }

    .timeline-avatar {
        width: 56px;
        height: 56px;
    }

    .drawer-content {
        width: 300px;
    }
}

/* ========== LARGE MOBILE / SMALL TABLET (640px - 767px) ========== */
@media screen and (min-width: 640px) {
    :root {
        --spacing-lg: 2rem;
        --spacing-xl: 2.5rem;
    }

    .hero-slider {
        height: 400px;
    }

    .slider-overlay {
        padding: var(--spacing-2xl);
    }

    .slider-title {
        font-size: var(--font-size-4xl);
    }

    .section {
        padding: var(--spacing-2xl) var(--spacing-lg);
    }

    .section-title {
        font-size: var(--font-size-3xl);
    }

    /* Grid layouts */
    .card-grid-2 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .timeline-actions {
        max-width: 500px;
    }

    /* Profile section enhancements */
    .profile-section {
        padding: var(--spacing-3xl) var(--spacing-xl);
    }

    .profile-image-container {
        width: 160px;
        height: 160px;
    }

    .profile-section .profile-stats {
        gap: var(--spacing-3xl);
    }

    /* Career timeline adjustments */
    .career-timeline::before {
        left: 39px;
    }

    .career-item {
        padding-left: 60px;
    }

    .career-marker {
        left: 28px;
        width: 24px;
        height: 24px;
    }
}

/* ========== TABLET (768px - 1023px) ========== */
@media screen and (min-width: 768px) {
    :root {
        --header-height: 64px;
        --tab-nav-height: 48px;
    }

    /* Status bar hidden on larger screens */
    .status-bar {
        display: none;
    }

    .app-header {
        top: 0;
    }

    /* Enhanced header */
    .header-container {
        max-width: 720px;
        margin: 0 auto;
        padding: 0 var(--spacing-lg);
    }

    .logo-img {
        height: 40px;
    }

    /* Larger slider */
    .hero-slider {
        height: 450px;
    }

    /* Content container */
    .app-main {
        max-width: 720px;
        margin: 0 auto;
    }

    /* Grid layouts */
    .card-grid-2,
    .card-grid-tablet-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    .card-grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }

    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 500px;
        margin: 0 auto;
    }

    /* Award list in 2 columns */
    .award-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    /* FAQ wider */
    .faq-list {
        max-width: 600px;
        margin: 0 auto;
    }

    /* Contact info grid */
    .contact-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    /* Bottom navigation styles - can show on tablet */
    .bottom-nav {
        max-width: 720px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    /* Timeline with more space */
    .timeline-item {
        padding: var(--spacing-lg) var(--spacing-xl);
    }

    /* Drawer wider on tablet */
    .drawer-content {
        width: 340px;
    }

    .drawer-profile {
        padding: var(--spacing-2xl);
    }

    .nav-item a {
        padding: var(--spacing-md) var(--spacing-xl);
    }

    /* FAB positioning */
    .fab {
        right: calc(50% - 360px + var(--spacing-lg));
    }
}

/* ========== LARGE TABLET / SMALL DESKTOP (1024px - 1279px) ========== */
@media screen and (min-width: 1024px) {
    :root {
        --header-height: 68px;
        --bottom-nav-height: 0px;
    }

    /* Hide mobile bottom navigation on desktop */
    .bottom-nav {
        display: none;
    }

    /* Reset app main padding */
    .app-main {
        padding-bottom: var(--spacing-xl);
        max-width: 900px;
    }

    /* Header becomes more desktop-like */
    .header-container {
        max-width: 900px;
    }

    /* Show desktop navigation in header */
    .menu-btn {
        display: none;
    }

    .header-center {
        justify-content: flex-start;
        padding-left: var(--spacing-md);
    }

    /* Desktop navigation within header */
    .desktop-nav {
        display: flex;
        align-items: center;
        gap: var(--spacing-md);
        margin-left: var(--spacing-xl);
    }

    .desktop-nav-item {
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-medium);
        color: var(--text-secondary);
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-full);
        transition: all var(--transition-fast);
    }

    .desktop-nav-item:hover {
        color: var(--text-primary);
        background-color: var(--bg-hover);
    }

    .desktop-nav-item.active {
        color: var(--color-primary);
    }

    /* Larger slider */
    .hero-slider {
        height: 500px;
        border-radius: 0;
    }

    /* Content container */
    .section {
        padding: var(--spacing-3xl) var(--spacing-xl);
    }

    /* Grids */
    .card-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .card-grid-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-lg);
    }

    /* Career timeline with more info visible */
    .career-timeline {
        max-width: 800px;
        margin: 0 auto;
    }

    /* FAB positioning for desktop */
    .fab {
        bottom: var(--spacing-xl);
        right: calc(50% - 450px + var(--spacing-lg));
    }

    /* Side drawer still usable but less prominent */
    .drawer-content {
        box-shadow: var(--shadow-xl);
    }

    /* Profile section full width with gradient */
    .profile-section {
        border-radius: 0;
    }
}

/* ========== DESKTOP (1280px+) ========== */
@media screen and (min-width: 1280px) {
    .app-main {
        max-width: 1100px;
    }

    .header-container {
        max-width: 1200px;
    }

    /* Hero slider full experience */
    .hero-slider {
        height: 550px;
    }

    .slider-overlay {
        padding: var(--spacing-3xl);
    }

    .slider-title {
        font-size: 3rem;
    }

    /* Section layout */
    .section {
        max-width: 1100px;
        margin: 0 auto;
    }

    /* Two-column layouts */
    .two-column-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
        align-items: start;
    }

    .two-column-layout.reverse {
        grid-template-columns: 1fr 1fr;
    }

    .two-column-layout.reverse > *:first-child {
        order: 2;
    }

    .two-column-layout.reverse > *:last-child {
        order: 1;
    }

    /* Sidebar layout */
    .sidebar-layout {
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: var(--spacing-xl);
    }

    .sidebar-layout .sidebar {
        position: sticky;
        top: calc(var(--header-height) + var(--spacing-lg));
    }

    /* Timeline in 2 columns */
    .timeline-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    .timeline-grid .timeline-item {
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
    }

    /* Award badges grid */
    .award-list {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Contact layout */
    .contact-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
    }

    .map-container {
        height: 300px;
    }

    /* FAB positioning */
    .fab {
        right: calc(50% - 550px + var(--spacing-lg));
    }
}

/* ========== LARGE DESKTOP (1440px+) ========== */
@media screen and (min-width: 1440px) {
    .app-main,
    .header-container,
    .section {
        max-width: 1280px;
    }

    .hero-slider {
        height: 600px;
    }

    /* Even more grid columns */
    .card-grid-5 {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: var(--spacing-lg);
    }

    .award-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== ULTRA WIDE (1920px+) ========== */
@media screen and (min-width: 1920px) {
    .app-main,
    .header-container,
    .section {
        max-width: 1400px;
    }

    .hero-slider {
        height: 700px;
        max-width: 1600px;
        margin: 0 auto;
    }
}

/* ========== HOVER MEDIA QUERY ========== */
/* Apply hover effects only on devices that support hover */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-4px);
    }

    .timeline-item:hover {
        background-color: var(--bg-hover);
    }

    .btn-primary:hover {
        transform: translateY(-2px);
    }

    .award-item:hover {
        transform: translateX(5px);
    }

    .slider-arrow {
        opacity: 0;
    }

    .hero-slider:hover .slider-arrow {
        opacity: 1;
    }
}

/* ========== TOUCH DEVICE ADJUSTMENTS ========== */
@media (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .header-btn {
        width: 44px;
        height: 44px;
    }

    .bottom-nav-item {
        min-width: 44px;
    }

    .nav-item a {
        min-height: 48px;
    }

    .faq-question {
        min-height: 48px;
    }

    /* Remove hover effects on touch devices */
    .card:hover,
    .timeline-item:hover,
    .btn-primary:hover,
    .award-item:hover {
        transform: none;
    }

    /* Show slider arrows always on touch */
    .slider-arrow {
        opacity: 1;
    }
}

/* ========== 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;
    }

    .drawer-content,
    .search-overlay,
    .fab {
        transition: none;
    }

    .loading-spinner,
    .spinner-ring {
        animation: none;
    }

    .glitch-effect::before,
    .glitch-effect::after {
        animation: none;
        content: none;
    }
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: high) {
    :root {
        --border-color: #ffffff;
        --text-secondary: #cccccc;
    }

    .card,
    .btn,
    .timeline-item,
    .faq-question {
        border-width: 2px;
    }

    .btn-primary {
        border: 2px solid var(--color-white);
    }
}

/* ========== DARK MODE OVERRIDE ========== */
/* Already using dark theme as default, but this ensures consistency */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* ========== LIGHT MODE SUPPORT (Optional) ========== */
/* Uncomment if you want to support light mode */
/*
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #ffffff;
        --bg-secondary: #f7f9f9;
        --bg-tertiary: #e7e9ea;
        --bg-elevated: #ffffff;
        --bg-card: #ffffff;
        --bg-hover: rgba(255, 107, 53, 0.1);

        --text-primary: #0f1419;
        --text-secondary: #536471;
        --text-tertiary: #71767b;

        --border-color: #e7e9ea;
        --border-light: #cfd9de;
    }
}
*/

/* ========== LANDSCAPE ORIENTATION ========== */
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* Compact layout for landscape mobile */
    .status-bar {
        display: none;
    }

    .app-header {
        top: 0;
    }

    :root {
        --header-height: 50px;
        --bottom-nav-height: 50px;
    }

    .hero-slider {
        height: 200px;
    }

    .profile-section {
        padding: var(--spacing-lg);
    }

    .profile-image-container {
        width: 80px;
        height: 80px;
    }

    /* Horizontal profile layout */
    .profile-section {
        display: flex;
        align-items: center;
        gap: var(--spacing-lg);
        text-align: left;
    }

    .profile-section > * {
        margin-bottom: 0;
    }
}

/* ========== SAFE AREA INSETS (Notch Support) ========== */
@supports (padding: max(0px)) {
    .status-bar {
        padding-top: max(0px, env(safe-area-inset-top));
        height: calc(var(--status-bar-height) + env(safe-area-inset-top, 0px));
    }

    .bottom-nav {
        padding-bottom: max(var(--spacing-sm), env(safe-area-inset-bottom));
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .side-drawer .drawer-content {
        padding-top: env(safe-area-inset-top, 0px);
    }

    .app-main {
        padding-bottom: calc(var(--bottom-nav-height) + var(--spacing-md) + env(safe-area-inset-bottom, 0px));
    }
}

/* ========== CONTAINER QUERIES (Modern CSS) ========== */
@supports (container-type: inline-size) {
    .card-container {
        container-type: inline-size;
    }

    @container (min-width: 400px) {
        .card-container .card {
            display: flex;
            flex-direction: row;
        }

        .card-container .card-image {
            width: 40%;
            aspect-ratio: 1;
        }

        .card-container .card-content {
            width: 60%;
        }
    }
}

/* ========== STICKY FOOTER FIX ========== */
@media screen and (min-height: 800px) {
    .page-content-wrapper {
        min-height: calc(100vh - var(--header-height) - var(--status-bar-height) - var(--bottom-nav-height));
    }
}

/* ========== KEYBOARD NAVIGATION ========== */
/* Enhanced focus styles for keyboard navigation */
@media screen and (min-width: 768px) {
    .nav-item a:focus-visible,
    .bottom-nav-item:focus-visible,
    .btn:focus-visible,
    .card:focus-visible {
        outline: 3px solid var(--color-primary);
        outline-offset: 3px;
    }
}

/* ========== PRINT RESPONSIVE ========== */
@media print {
    .app-main {
        max-width: 100%;
        padding: 0;
    }

    .section {
        page-break-inside: avoid;
    }

    .card {
        page-break-inside: avoid;
    }

    .timeline-item {
        page-break-inside: avoid;
    }
}
