/* ─── Variables (ACTotal Theme) ─── */
:root {
    --bg: #050506;
    --surface: #111827;
    --surface-light: #1f2937;
    --surface-hover: #374151;
    --accent: #00A7E1;
    --accent-glow: rgba(0, 167, 225, 0.35);
    --text: #ffffff;
    --text-dim: #9ca3af;
    --radius: 20px;
    --radius-sm: 12px;
}

/* ─── Base Reset ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* ─── Layout ─── */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    position: relative;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #007bb5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, .08);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all .2s;
    font-size: 1.2rem;
}

.btn-icon:hover {
    background: var(--surface-light);
    color: var(--text);
}

/* ─── Content ─── */
.talles-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Tabs ─── */
.tabs-container {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--surface-light);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.helper-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 0.5rem 0;
}

/* ─── Grid & Cards ─── */
.conversion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.size-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.size-card.full-width {
    grid-column: 1 / -1;
    align-items: center;
}

.primary-card {
    background: linear-gradient(135deg, rgba(0, 167, 225, 0.1), rgba(0, 123, 181, 0.05));
    border-color: rgba(0, 167, 225, 0.2);
}

.card-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
}

.primary-card .card-label {
    color: var(--accent);
    font-weight: 600;
}

.card-value-group {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    position: relative;
}

.card-value-group.flex-center {
    justify-content: center;
}

.flag-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

.unit-label {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 600;
}

/* Hide native default arrow and style the select to look like a thick heading text */
.size-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    outline: none;
    cursor: pointer;
    padding: 0 0.2rem;
    letter-spacing: -0.02em;
    /* Custom simple down arrow via background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    padding-right: 1.2rem;
}

.highlight-select {
    color: var(--accent);
}

.size-select option {
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
}

/* ─── Footer ─── */
.app-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: auto;
    padding-top: 2rem;
    line-height: 1.5;
}

.app-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.disclaimer {
    font-style: italic;
    opacity: 0.8;
}