/* ===== Responsive Design for WooRi Info System ===== */

/* Mobile First Approach */

/* Base styles for mobile devices (0-639px) */
@media screen and (max-width: 639px) {
    /* Typography */
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    /* Layout */
    .container {
        padding: 0 15px;
    }
    
    /* Navigation */
    .main-header {
        height: 60px;
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    /* 모바일 메뉴 배경 강제 - 3차 방어 */
    .mobile-menu {
        background-color: #ffffff !important;
        background: #ffffff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        opacity: 1 !important;
    }
    
    .mobile-menu.active {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .mobile-dropdown-content {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .mobile-dropdown-content.show {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 60px);
        background-color: #ffffff !important;
        background: #ffffff !important;
        flex-direction: column;
        padding: 20px;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--gray-700);
        cursor: pointer;
        padding: 10px;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--gray-50);
        margin-top: 10px;
        margin-left: 20px;
    }
    
    /* Cards */
    .feature-cards,
    .solutions-grid,
    .clients-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Tabs */
    .tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        min-width: 120px;
        padding: 15px 10px;
        font-size: 0.875rem;
    }
    
    /* Solutions */
    .solutions-container {
        grid-template-columns: 1fr;
    }
    
    .rotating-images {
        display: none;
    }
    
    /* Footer */
    .footer-content {
        text-align: center;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Tables */
    table {
        font-size: 0.875rem;
    }
    
    /* Spacing */
    section {
        padding: 60px 0;
    }
    
    /* Hide desktop-only elements */
    .desktop-only {
        display: none;
    }
}

/* Small tablets (640px - 767px) */
@media screen and (min-width: 640px) and (max-width: 767px) {
    .container {
        padding: 0 20px;
    }
    
    .feature-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-header {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    /* 모바일 메뉴 배경 강제 - 3차 방어 */
    .mobile-menu {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .mobile-dropdown-content {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 70%;
        height: calc(100vh - 80px);
        background-color: #ffffff !important;
        background: #ffffff !important;
        flex-direction: column;
        padding: 30px;
        transition: left 0.3s ease;
    }
    
    .nav-menu.active {
        left: 0;
    }
}

/* Tablets (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 30px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .feature-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .management-card {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    .main-header {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .nav-menu {
        position: static;
        flex-direction: row;
        width: auto;
        height: auto;
        background-color: transparent !important;
        background: transparent !important;
        padding: 0;
    }
    
    .tab-button {
        min-width: 140px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop (1024px - 1279px) */
@media screen and (min-width: 1024px) and (max-width: 1279px) {
    .container {
        max-width: 960px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    .feature-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .solutions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

/* Large Desktop (1280px and up) */
@media screen and (min-width: 1280px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    .feature-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .solutions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

/* Extra Large Desktop (1920px and up) */
@media screen and (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 2rem;
    }
}

/* Portrait orientation specific */
@media screen and (orientation: portrait) {
    .hero-section {
        min-height: 100vh;
    }
}

/* Landscape orientation specific */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 500px;
    }
    
    .main-header {
        height: 60px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Use higher resolution images */
    .logo {
        background-image: url('/images/logo@2x.png');
        background-size: contain;
    }
}

/* Print Styles */
@media print {
    .main-header,
    .footer,
    .mobile-menu-toggle,
    .tabs-nav,
    .btn-primary,
    .scroll-indicator {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .hero-section {
        height: auto;
        min-height: auto;
        background: none;
        color: black;
    }
}

/* Hover states for desktop only */
@media (hover: hover) {
    .feature-card:hover {
        transform: translateY(-10px);
    }
    
    .solution-card:hover {
        transform: scale(1.05);
    }
    
    .btn-primary:hover {
        transform: translateY(-3px);
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .feature-card:active,
    .solution-card:active {
        transform: scale(0.98);
    }
    
    .btn-primary {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Accessibility - Focus visible */
@media (prefers-reduced-motion: no-preference) {
    .smooth-scroll {
        scroll-behavior: smooth;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
}

/* Utility classes for responsive display */
.mobile-only {
    display: block;
}

.tablet-only {
    display: none;
}

.desktop-only {
    display: none;
}

@media screen and (min-width: 768px) {
    .mobile-only {
        display: none;
    }
    
    .tablet-only {
        display: block;
    }
}

@media screen and (min-width: 1024px) {
    .tablet-only {
        display: none;
    }
    
    .desktop-only {
        display: block;
    }
}

/* Responsive spacing utilities */
.mt-mobile-4 { margin-top: 1rem; }
.mt-tablet-6 { margin-top: 1.5rem; }
.mt-desktop-8 { margin-top: 2rem; }

@media screen and (min-width: 768px) {
    .mt-mobile-4 { margin-top: 1.5rem; }
    .mt-tablet-6 { margin-top: 2rem; }
}

@media screen and (min-width: 1024px) {
    .mt-mobile-4 { margin-top: 2rem; }
    .mt-tablet-6 { margin-top: 2.5rem; }
    .mt-desktop-8 { margin-top: 3rem; }
}