/* ============================================
   MOBILE-FIRST RESPONSIVE STYLES
   Designed to work on all screen sizes
   ============================================ */

:root {
    --mobile-padding: 12px;
    --tablet-padding: 16px;
}

/* BASE - Mobile First */
body {
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
    max-width: 100%;
}

h1 { font-size: 1.5rem; margin-bottom: 12px; }
h2 { font-size: 1.2rem; margin-bottom: 10px; }
h3 { font-size: 1rem; margin-bottom: 8px; }

/* CONTAINER - Mobile First */
.container {
    width: 100%;
    padding: 0 var(--mobile-padding);
    margin: 0 auto;
}

/* HEADER - Mobile First */
.site-header {
    padding: 8px 0;
}

.site-header .nav {
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.logo { width: 32px; height: 32px; font-size: 0.8rem; }
.brand-text .brand-title { font-size: 0.85rem; }
.brand-text .brand-tagline { font-size: 0.6rem; }
.nav-links a { font-size: 11px; padding: 4px 6px; }

/* BUTTONS - Mobile First */
button, .btn, input[type="submit"] {
    width: 100%;
    padding: 10px 10px;
    font-size: 13px;
    min-height: 44px;
    margin-bottom: 8px;
}

.nav-links a, .translator button, [style*="display:inline"] {
    width: auto;
    padding: auto;
    margin: 0;
}

/* FORMS - Mobile First */
input, textarea, select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group { margin-bottom: 12px; }

/* GRIDS - Mobile First (1 column) */
.grid, .grid-2, .grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* CARDS */
.card, [class*="card"] {
    padding: 12px;
    border-radius: 6px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 12px;
}

/* TABLES - Mobile Card View */
table { font-size: 12px; }
table thead { display: none; }
table tbody, table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
table td {
    display: block;
    padding: 8px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
}
table td:last-child { border: none; }

/* SIDEBAR */
.sidebar, aside { width: 100%; margin-bottom: 20px; }

/* SECTION */
.section { padding: 16px 0; }

/* ============================================
   TABLET - 768px+
   ============================================ */

@media (min-width: 768px) {
    .container {
        padding: 0 var(--tablet-padding);
        max-width: 1100px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.1rem; }

    .site-header { padding: 10px 0; }
    .site-header .nav { gap: 10px; }
    .logo { width: 36px; height: 36px; }
    .brand-text .brand-title { font-size: 0.95rem; }
    .brand-text .brand-tagline { font-size: 0.7rem; }
    .nav-links a { font-size: 12px; padding: 6px 8px; }

    button, .btn, input[type="submit"] {
        width: auto;
        padding: 10px 14px;
        margin-bottom: 0;
    }

    form button, form .btn {
        width: 100%;
    }

    input, textarea, select {
        font-size: 14px;
        padding: 10px 12px;
    }

    .form-group { margin-bottom: 14px; }

    .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 14px; }

    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: repeat(2"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }

    [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 14px !important;
    }

    .card, [class*="card"] { padding: 14px; }

    table { font-size: 13px; }
    table thead { display: table-header-group; }
    table tbody, table tr { display: table-row; border: none; }
    table th, table td {
        padding: 10px;
        display: table-cell;
        border-bottom: 1px solid #eee;
    }
    table td:before { display: none; }

    .sidebar, aside { width: 280px; }
    .section { padding: 28px 0; }
}

/* ============================================
   DESKTOP - 1024px+
   ============================================ */

@media (min-width: 1024px) {
    .container {
        padding: 0 24px;
        max-width: 1200px;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.3rem; }

    .site-header { padding: 12px 0; }
    .site-header .nav { gap: 14px; }
    .logo { width: 44px; height: 44px; }
    .brand-text .brand-title { font-size: 1.05rem; }
    .brand-text .brand-tagline { font-size: 0.78rem; }
    .nav-links a { font-size: 13px; padding: 8px 10px; }

    button, .btn, input[type="submit"] {
        padding: 10px 16px;
    }

    .grid-4 { grid-template-columns: repeat(4, 1fr); gap: 18px; }
    .grid-3 { gap: 18px; }
    .grid-2 { gap: 18px; }

    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 18px !important;
    }

    .card, [class*="card"] { padding: 16px; }
    .section { padding: 40px 0; }
    .sidebar, aside { width: 300px; }
}

/* UTILITIES */
img { max-width: 100%; height: auto; }
button, a, input, select { min-height: 44px; }

.hide-mobile { display: none; }
@media (min-width: 768px) {
    .hide-mobile { display: block; }
    .show-mobile { display: none; }
}
