/**
 * responsive.css - Responsive Styles
 * 프로그래머 문호영 - Corporate Website
 *
 * Mobile-First Responsive Design
 * Breakpoints: 480px, 640px, 768px, 1024px, 1200px
 *
 * @package TION_Corporate
 * @version 1.0.0
 */

/* ==========================================================================
   Mobile First Base (< 480px)
   ========================================================================== */

/* Typography adjustments for small screens */
h1 {
    font-size: var(--text-2xl);
}

h2 {
    font-size: var(--text-xl);
}

h3 {
    font-size: var(--text-lg);
}

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

.section-description {
    font-size: var(--text-base);
}

/* Container padding */
.container {
    padding: 0 var(--space-4);
}

/* Section spacing */
.section {
    padding: var(--space-12) 0;
}

.section-lg {
    padding: var(--space-16) 0;
}

/* Header mobile */
.site-header {
    height: var(--header-height-mobile);
}

.header-inner {
    padding: 0 var(--space-4);
}

.logo-icon svg {
    width: 32px;
    height: 32px;
}

.logo-text {
    display: none;
}

.main-nav {
    display: none;
}

.btn-mobile-menu {
    display: flex;
}

/* Page hero mobile */
.page-hero {
    padding: var(--space-12) 0;
}

.page-hero-title {
    font-size: var(--text-3xl);
}

.page-hero-description {
    font-size: var(--text-base);
}

/* Grid mobile */
.grid-cols-2,
.grid-cols-3,
.grid-cols-4 {
    grid-template-columns: 1fr;
}

/* Footer mobile */
.footer-main {
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

.footer-about {
    text-align: center;
}

.footer-social {
    justify-content: center;
}

.footer-section {
    text-align: center;
}

.footer-section ul {
    align-items: center;
}

.footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
}

.footer-legal {
    flex-wrap: wrap;
    justify-content: center;
}

/* Footer Business Info mobile */
.footer-business-info {
    flex-direction: column;
    text-align: center;
}

.business-info-content {
    justify-content: center;
}

.business-info-links {
    justify-content: center;
}

/* Back to top mobile */
.back-to-top {
    width: 44px;
    height: 44px;
    right: var(--space-4);
    bottom: var(--space-4);
}

/* Toast mobile */
.toast-container {
    left: var(--space-4);
    right: var(--space-4);
}

.toast {
    min-width: auto;
    max-width: none;
}

/* Modal mobile */
.modal {
    margin: var(--space-4);
    max-height: calc(100vh - var(--space-8));
}

.modal-header {
    padding: var(--space-4);
}

.modal-body {
    padding: var(--space-4);
}

.modal-footer {
    padding: var(--space-4);
    flex-direction: column;
}

.modal-footer .btn {
    width: 100%;
}

/* Forms mobile */
.form-group {
    margin-bottom: var(--space-4);
}

/* Cards mobile */
.card-body {
    padding: var(--space-4);
}

/* Tables mobile */
.table-container {
    margin: 0 calc(var(--space-4) * -1);
    border-radius: 0;
    border-left: none;
    border-right: none;
}

/* ==========================================================================
   Small Mobile (>= 480px)
   ========================================================================== */

@media (min-width: 480px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .footer-section {
        text-align: left;
    }

    .footer-section ul {
        align-items: flex-start;
    }
}

/* ==========================================================================
   Mobile Landscape / Small Tablet (>= 640px)
   ========================================================================== */

@media (min-width: 640px) {
    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }

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

    .container {
        padding: 0 var(--space-6);
    }

    .page-hero-title {
        font-size: var(--text-4xl);
    }

    .page-hero-description {
        font-size: var(--text-lg);
    }

    .modal-footer {
        flex-direction: row;
    }

    .modal-footer .btn {
        width: auto;
    }
}

/* ==========================================================================
   Tablet (>= 768px)
   ========================================================================== */

@media (min-width: 768px) {
    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    h3 {
        font-size: var(--text-2xl);
    }

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

    .section {
        padding: var(--space-16) 0;
    }

    .section-lg {
        padding: var(--space-20) 0;
    }

    /* Header tablet */
    .site-header {
        height: var(--header-height);
    }

    .logo-text {
        display: flex;
    }

    .logo-icon svg {
        width: 40px;
        height: 40px;
    }

    /* Grid tablet */
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Footer tablet */
    .footer-main {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .footer-about {
        text-align: left;
    }

    .footer-social {
        justify-content: flex-start;
    }

    .footer-bottom {
        flex-direction: row;
    }

    /* Page hero tablet */
    .page-hero {
        padding: var(--space-16) 0;
    }

    /* Cards tablet */
    .card-body {
        padding: var(--space-5);
    }

    /* Tables tablet */
    .table-container {
        margin: 0;
        border-radius: var(--radius-xl);
        border-left: 1px solid var(--border-light);
        border-right: 1px solid var(--border-light);
    }
}

/* ==========================================================================
   Desktop (>= 1024px)
   ========================================================================== */

@media (min-width: 1024px) {
    /* Header desktop */
    .main-nav {
        display: flex;
    }

    .btn-mobile-menu {
        display: none;
    }

    .mobile-nav {
        display: none !important;
    }

    /* Grid desktop */
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

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

    /* Footer desktop */
    .footer-main {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }

    /* Page hero desktop */
    .page-hero {
        padding: var(--space-20) 0;
    }

    .page-hero-title {
        font-size: var(--text-5xl);
    }

    /* Cards desktop */
    .card-body {
        padding: var(--space-6);
    }

    /* Feature card hover effects */
    .feature-card {
        transition: all var(--transition-normal);
    }

    .feature-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-xl);
    }
}

/* ==========================================================================
   Large Desktop (>= 1200px)
   ========================================================================== */

@media (min-width: 1200px) {
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .section {
        padding: var(--space-20) 0;
    }

    .section-lg {
        padding: var(--space-24) 0;
    }
}

/* ==========================================================================
   Extra Large Desktop (>= 1400px)
   ========================================================================== */

@media (min-width: 1400px) {
    .container {
        max-width: var(--container-2xl);
    }

    h1 {
        font-size: var(--text-5xl);
    }

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

    .page-hero-title {
        font-size: var(--text-6xl);
    }
}

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

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    abbr[title]::after {
        content: " (" attr(title) ")";
    }

    a[href^="#"]::after,
    a[href^="javascript:"]::after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }

    .site-header,
    .site-footer,
    .main-nav,
    .mobile-nav,
    .back-to-top,
    .toast-container,
    .modal-container,
    .antigravity-effect,
    .btn,
    button {
        display: none !important;
    }

    .site-main {
        padding-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;
    }

    .back-to-top,
    .card,
    .feature-card,
    .btn {
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
    :root {
        --color-primary: #0000ff;
        --color-secondary: #800080;
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-light: #000000;
        --border-medium: #000000;
    }

    .btn-primary {
        background: #0000ff;
    }

    .card {
        border: 2px solid #000000;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional - Uncomment to enable)
   ========================================================================== */

/*
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-tertiary: #94a3b8;
        --border-light: #334155;
        --border-medium: #475569;
    }

    .site-header {
        background: rgba(15, 23, 42, 0.95);
        border-color: var(--border-light);
    }

    .card {
        background: var(--bg-secondary);
    }

    .form-control {
        background: var(--bg-secondary);
        border-color: var(--border-light);
        color: var(--text-primary);
    }

    .dropdown-menu {
        background: var(--bg-secondary);
    }

    .modal {
        background: var(--bg-secondary);
    }

    .toast {
        background: var(--bg-secondary);
    }
}
*/

/* ==========================================================================
   Landscape Orientation Specific
   ========================================================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .site-header {
        height: 50px;
    }

    .site-main {
        padding-top: 50px;
    }

    .page-hero {
        padding: var(--space-8) 0;
    }

    .page-hero-title {
        font-size: var(--text-2xl);
    }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .nav-item > a:hover {
        background: transparent;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        padding: 0;
        padding-left: var(--space-4);
    }

    .nav-item.has-dropdown > a::after {
        display: none;
    }

    /* Larger touch targets */
    .btn,
    .nav-item > a,
    .form-control {
        min-height: 44px;
    }

    /* Disable hover-dependent features */
    .card:hover {
        transform: none;
    }

    .project-card .card-overlay {
        opacity: 1;
        background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.7) 100%);
    }

    .project-card .card-content {
        transform: none;
        opacity: 1;
    }
}

/* ==========================================================================
   Retina / High DPI Screens
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders */
    .card,
    .form-control,
    .btn-outline {
        border-width: 0.5px;
    }
}

/* ==========================================================================
   Safe Area Insets (iPhone X and newer)
   ========================================================================== */

@supports (padding: env(safe-area-inset-bottom)) {
    .site-footer {
        padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
    }

    .back-to-top {
        bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
    }

    .mobile-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ==========================================================================
   Container Query Support (Modern Browsers)
   ========================================================================== */

@supports (container-type: inline-size) {
    .card-container {
        container-type: inline-size;
    }

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

        .card-image {
            flex: 0 0 40%;
            aspect-ratio: 1;
        }

        .card-body {
            flex: 1;
        }
    }
}
