/* Âm Lịch VN – UI đồng bộ với app Android */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --text: #111111;
    --text-muted: #616161;
    --text-label: #424242;
    --border: #E0E0E0;
    --bg-page: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-subtle: #FAFAFA;
    --accent: #F4511E;
    --accent-soft: #FFF3E0;
    --accent-tab: #0288D1;
    --good: #2E7D32;
    --warn: #E65100;
    --fs: 17px;
    --fs-sm: 15px;
    --fs-label: 16px;
    --fs-result: 18px;
    --fs-result-label: 15px;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text);
    font-size: var(--fs);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 12px 16px 24px;
    box-sizing: border-box;
}

.page-card,
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #EEEEEE;
}

.page-card {
    padding: 16px;
}

.page-title {
    margin: -16px -16px 16px;
    padding: 14px 16px;
    background: var(--accent);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    border-radius: 16px 16px 0 0;
    font-family: inherit;
}

.section-divider {
    height: 1px;
    background: #EEEEEE;
    margin: 14px 0;
}

/* Trang chủ tiện ích */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.util-item {
    display: block;
    padding: 14px 8px 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #EEEEEE;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.12s;
}

.util-item:active {
    transform: scale(0.97);
}

.util-icon {
    width: 74px;
    height: 74px;
    border-radius: 18px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.util-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.util-label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text);
}

.theme-blue { background: #E3F2FD; }
.theme-green { background: #E8F5E9; }
.theme-red { background: #FBE9E7; }
.theme-yellow { background: #FFF8E1; }
.theme-purple { background: #F3E5F5; }
.theme-orange { background: #FFF3E0; }

/* Tabs / nút */
.type-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.type-tab {
    display: block;
    width: 100%;
    padding: 12px 8px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: #fff;
    text-align: center;
    font-size: var(--fs-label);
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    touch-action: manipulation;
}

.type-tab.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

button[type="submit"],
.btn-primary,
.back-home,
.back {
    font-family: inherit;
}

button[type="submit"],
.btn-primary {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: var(--fs);
    font-weight: 700;
    cursor: pointer;
    min-height: 48px;
}

button[type="submit"]:active,
.btn-primary:active {
    opacity: 0.9;
}

.back-home,
.back {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

/* Wheel picker */
.wheel-picker {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.wheel-col { min-width: 0; }

.wheel-label {
    display: block;
    font-size: var(--fs-label);
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin: 0 0 6px;
}

.wheel-wrap {
    position: relative;
    height: 110px;
    overflow: hidden;
    background: var(--bg-subtle);
    border-radius: 12px;
    border: 1.5px solid var(--border);
}

.wheel-highlight {
    position: absolute;
    top: 50%;
    left: 6px;
    right: 6px;
    height: 34px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.04);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    pointer-events: none;
    z-index: 2;
}

.wheel-scroll {
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    z-index: 1;
    position: relative;
}

.wheel-scroll::-webkit-scrollbar { display: none; }

.wheel-spacer { height: 38px; flex-shrink: 0; }

.wheel-item {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    opacity: 0.55;
    user-select: none;
}

.wheel-item.active {
    color: var(--text);
    opacity: 1;
    font-size: 18px;
    font-weight: 600;
}

/* Form */
.search-box input,
input[type="text"],
input[type="number"],
input[type="search"],
select,
textarea {
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
}

.search-box input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--bg-subtle);
}

.list-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.list-item {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: var(--fs-result);
    color: var(--text);
}

.list-item:last-child { border-bottom: none; }

.list-item:active { background: var(--bg-subtle); }

.list-item .index {
    color: var(--accent);
    margin-right: 6px;
    font-weight: 600;
}

/* KQXS */
.header {
    background: var(--accent) !important;
    color: #fff;
    text-align: center;
    padding: 14px;
    font-weight: 700;
    font-size: 18px;
}

.region-tabs button.active,
.tabs a.active .item {
    background: var(--accent) !important;
    color: #fff !important;
}

.region-tabs button {
    font-family: inherit;
    border-radius: 20px;
}

.item {
    font-family: inherit;
}

@media (max-width: 360px) {
    .grid { gap: 10px; }
    .util-item { padding: 12px 6px 14px; }
    .util-icon { width: 64px; height: 64px; }
    .util-icon img { width: 42px; height: 42px; }
    .util-label { font-size: 14px; }
}
