/* css/responsive.css - Responsive Design for AlohaFly Yoga */

/* Base Responsive Settings */
* {
    box-sizing: border-box;
}

/* Mobile First Approach */
.container {
    width: 100%;
    padding: 0 15px;
    margin: 0 auto;
}

/* Extra Small Devices (Phones, less than 576px) */
@media (max-width: 575.98px) {
    body {
        padding: 10px !important;
        font-size: 14px;
    }
    
    .header h1 {
        font-size: 1.8rem !important;
    }
    
    .header p {
        font-size: 1rem !important;
    }
    
    .tools-grid {
        grid-template-columns: 1fr !important;
        padding: 15px !important;
        gap: 15px !important;
    }
    
    .tool-card {
        padding: 20px 15px !important;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #dee2e6;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100% !important;
        margin-bottom: 10px;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px !important;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .output-box {
        margin: 10px !important;
        padding: 15px !important;
        font-size: 12px;
        max-height: 300px;
    }
    
    .warning-box {
        margin: 10px !important;
        padding: 12px !important;
    }
}

/* Small Devices (Tablets, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        padding: 20px !important;
    }
    
    .header {
        padding: 25px !important;
    }
    
    .filter-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    table {
        font-size: 15px;
    }
}

/* Medium Devices (Tablets/Laptops, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .header {
        padding: 30px !important;
    }
}

/* Large Devices (Desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
}

/* Extra Large Devices (Large Desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        padding: 0 !important;
    }
    
    .container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .header {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #000 !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    .btn {
        display: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: #121212 !important;
        color: #e0e0e0 !important;
    }
    
    .container {
        background: #1e1e1e !important;
        box-shadow: 0 2px 20px rgba(0,0,0,0.3) !important;
    }
    
    .header {
        background: linear-gradient(135deg, #0d1b47, #1a2a6c) !important;
    }
    
    .back-nav {
        background: #2d2d2d !important;
        border-color: #404040 !important;
    }
    
    .tool-card {
        background: #2d2d2d !important;
        border-color: #404040 !important;
    }
    
    .tool-card h3 {
        color: #e0e0e0 !important;
    }
    
    .tool-card p {
        color: #b0b0b0 !important;
    }
    
    .output-box {
        background: #2d2d2d !important;
        border-color: #404040 !important;
        color: #e0e0e0 !important;
    }
    
    .warning-box {
        background: #332211 !important;
        border-color: #664422 !important;
        color: #ffcc99 !important;
    }
    
    input, select, textarea {
        background: #2d2d2d !important;
        border-color: #404040 !important;
        color: #e0e0e0 !important;
    }
    
    table {
        color: #e0e0e0 !important;
    }
    
    th {
        background: #2d2d2d !important;
        color: #e0e0e0 !important;
    }
    
    tr:hover {
        background: #333333 !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        color: #0000EE !important;
        text-decoration: underline !important;
    }
    
    .btn {
        border: 2px solid black !important;
    }
    
    input, select, textarea {
        border: 2px solid black !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tool-card:hover {
        transform: none !important;
    }
    
    .btn:hover {
        transform: none !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* Apple's recommended touch target */
        min-width: 44px;
    }
    
    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    .tab {
        padding: 15px 20px; /* Larger touch target */
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 15px !important;
    }
    
    .header h1 {
        font-size: 1.5rem !important;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 15px !important;
        padding: 15px !important;
    }
}

/* Utility Classes for Responsive */
.hidden-mobile {
    display: block;
}

.hidden-desktop {
    display: none;
}

@media (max-width: 767.98px) {
    .hidden-mobile {
        display: none !important;
    }
    
    .hidden-desktop {
        display: block !important;
    }
    
    .mobile-stack {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .mobile-center {
        text-align: center !important;
    }
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

@media (max-width: 767.98px) {
    .col-6, .col-4, .col-3 {
        width: 100%;
    }
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Typography Scaling */
html {
    font-size: 16px;
}

@media (max-width: 575.98px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    html {
        font-size: 15px;
    }
    
    h1 { font-size: 2.25rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
}