/*
 * Vo Song UI Refresh
 * Presentation-only overrides. Business logic and form contracts stay untouched.
 */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');

:root {
    --ui-accent: #2dd4bf;
    --ui-accent-strong: #0f9f91;
    --ui-gold: #f4bb62;
    --ui-ink: #07111f;
    --ui-panel: rgba(13, 27, 45, 0.86);
    --ui-panel-solid: #0d1b2d;
    --ui-line: rgba(148, 163, 184, 0.16);
    --ui-muted: #94a3b8;
    --ui-radius-sm: 12px;
    --ui-radius: 18px;
    --ui-radius-lg: 26px;
    --ui-shadow: 0 18px 50px rgba(2, 8, 23, 0.22);
    --ui-shadow-soft: 0 10px 30px rgba(2, 8, 23, 0.14);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Be Vietnam Pro', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(45, 212, 191, 0.35) !important;
    outline-offset: 3px;
}

::selection {
    color: #041310;
    background: rgba(45, 212, 191, 0.75);
}

/* Authentication and account forms */
body.ui-auth {
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    padding: 72px 22px 40px;
    color: #172033;
    background:
        radial-gradient(circle at 12% 15%, rgba(45, 212, 191, 0.2), transparent 30%),
        radial-gradient(circle at 88% 82%, rgba(244, 187, 98, 0.2), transparent 30%),
        linear-gradient(145deg, #eaf8f5, #f5f8fc 56%, #fff8ed) !important;
}

body.ui-auth::before,
body.ui-auth::after {
    position: fixed;
    z-index: -1;
    content: '';
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

body.ui-auth::before {
    top: -180px;
    right: -100px;
    width: 480px;
    height: 480px;
    box-shadow: inset 0 0 90px rgba(45, 212, 191, 0.06);
}

body.ui-auth::after {
    bottom: -240px;
    left: -160px;
    width: 560px;
    height: 560px;
    box-shadow: inset 0 0 100px rgba(244, 187, 98, 0.05);
}

.ui-auth > .container {
    max-width: 500px !important;
}

.ui-auth.ui-auth-wide > .container {
    max-width: 920px !important;
}

.ui-auth .card {
    overflow: hidden;
    border: 1px solid rgba(15, 159, 145, 0.12);
    border-radius: var(--ui-radius-lg);
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 30px 80px rgba(25, 53, 72, 0.14);
    backdrop-filter: blur(20px);
}

.ui-auth .card-header {
    position: relative;
    padding: 34px 32px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(115deg, rgba(45, 212, 191, 0.18), rgba(13, 27, 45, 0.05)),
        #10283c;
}

.ui-auth .card-header::after {
    position: absolute;
    right: -45px;
    bottom: -65px;
    width: 170px;
    height: 170px;
    content: '';
    border: 24px solid rgba(244, 187, 98, 0.07);
    border-radius: 50%;
}

.ui-auth .card-header h1 {
    position: relative;
    z-index: 1;
    margin-bottom: 9px;
    font-size: clamp(24px, 5vw, 30px);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.ui-auth .card-header h1 i {
    margin-right: 8px;
    color: var(--ui-gold);
}

.ui-auth .card-header p {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.68);
}

.ui-auth .card-body {
    padding: 32px;
}

.ui-auth .form-label {
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ui-auth .form-control,
.ui-auth select,
.ui-auth textarea {
    min-height: 48px;
    color: #172033;
    border: 1px solid #dce5ec;
    border-radius: var(--ui-radius-sm);
    background: #f8fafc;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.ui-auth .form-control:focus,
.ui-auth select:focus,
.ui-auth textarea:focus {
    border-color: var(--ui-accent);
    background: rgba(45, 212, 191, 0.04);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
}

.ui-auth .input-icon i {
    color: var(--ui-accent);
}

.ui-auth .btn-primary {
    min-height: 50px;
    border-radius: var(--ui-radius-sm);
    background: linear-gradient(135deg, #1bb8a5, #0d8b81);
    box-shadow: 0 12px 28px rgba(15, 159, 145, 0.22);
    letter-spacing: .02em;
}

.ui-auth .btn-primary:hover {
    box-shadow: 0 16px 34px rgba(15, 159, 145, 0.32);
}

.ui-auth .card-footer {
    padding: 21px 30px;
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(241, 245, 249, 0.75);
}

.ui-auth .card-footer a,
.ui-auth a:not(.btn) {
    color: var(--ui-accent-strong);
}

/* Signed-in application shell */
body.ui-shell {
    --dark-bg: #f3f7f9;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --text-primary: #172033;
    --text-secondary: #64748b;
    --border-color: #dfe8ed;
    color: var(--text-primary);
    background:
        radial-gradient(circle at 82% 4%, rgba(45, 212, 191, 0.12), transparent 25%),
        var(--dark-bg) !important;
}

.ui-shell .sidebar {
    width: 268px;
    padding: 22px 14px;
    border-right: 1px solid var(--ui-line);
    background:
        radial-gradient(circle at 20% 0%, rgba(45, 212, 191, 0.13), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, .99), rgba(244, 249, 250, .99));
    box-shadow: 12px 0 40px rgba(2, 8, 23, 0.12);
    scrollbar-width: thin;
}

.ui-shell .sidebar-header {
    min-height: 78px;
    padding: 2px 14px 20px;
    border-bottom-color: var(--ui-line);
}

.ui-shell .sidebar-header img {
    max-width: 150px !important;
    max-height: 64px;
    animation: none !important;
    filter: drop-shadow(0 8px 18px rgba(45, 212, 191, 0.17));
}

.ui-shell .user-profile {
    margin: 16px 0 8px;
    padding: 16px 13px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: rgba(148, 163, 184, 0.055);
}

.ui-shell .user-avatar {
    color: #05231f;
    background: linear-gradient(145deg, #5eead4, #1aac9b);
    box-shadow: 0 8px 24px rgba(45, 212, 191, 0.2);
}

.ui-shell .stat-mini {
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    background: rgba(226, 232, 240, 0.48);
}

.ui-shell .stat-mini-value {
    color: var(--ui-accent);
}

.ui-shell .nav-menu {
    padding: 8px 0;
}

.ui-shell .nav-item {
    position: relative;
    min-height: 45px;
    margin: 3px 0;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-left: 1px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    transition: transform .2s ease, color .2s ease, background .2s ease, border-color .2s ease;
}

.ui-shell .nav-item i {
    width: 22px;
    color: #7890a5;
    font-size: 15px;
    text-align: center;
}

.ui-shell .nav-item:hover {
    color: var(--text-primary);
    border-color: rgba(45, 212, 191, 0.12);
    background: rgba(45, 212, 191, 0.07);
    transform: translateX(3px);
}

.ui-shell .nav-item:hover i,
.ui-shell .nav-item.active i {
    color: var(--ui-accent);
}

.ui-shell .nav-item.active {
    color: #08766c;
    border-color: rgba(45, 212, 191, 0.18);
    background: linear-gradient(100deg, rgba(45, 212, 191, 0.18), rgba(45, 212, 191, 0.04));
    box-shadow: inset 3px 0 0 var(--ui-accent);
}

.ui-shell .nav-separator {
    margin: 11px 13px;
    background: var(--ui-line);
}

.ui-shell .main-content {
    margin-left: 268px;
    padding: 30px clamp(20px, 3.2vw, 48px) 48px;
}

.ui-shell .top-bar,
.ui-shell .page-header {
    margin-bottom: 26px;
    padding: 16px 18px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--ui-shadow-soft);
    backdrop-filter: blur(16px);
}

.ui-shell .page-title h1,
.ui-shell .header-left h1 {
    font-size: clamp(23px, 3vw, 30px);
    font-weight: 800;
    letter-spacing: -0.045em;
}

.ui-shell .page-title h1::after,
.ui-shell .header-left h1::after {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    content: '';
    border-radius: 50%;
    background: var(--ui-gold);
    box-shadow: 0 0 14px rgba(244, 187, 98, .65);
}

/* Cards and content */
.ui-shell .stat-card,
.ui-shell .content-card,
.ui-shell .shop-item,
.ui-shell .history-card,
.ui-shell .download-card,
.ui-shell .requirement-box,
.ui-shell .info-card {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--card-bg);
    box-shadow: var(--ui-shadow-soft);
}

.ui-shell .stat-card {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    padding: 22px;
}

.ui-shell .stat-card::after {
    position: absolute;
    right: -28px;
    bottom: -34px;
    width: 100px;
    height: 100px;
    content: '';
    border: 18px solid rgba(45, 212, 191, 0.055);
    border-radius: 50%;
}

.ui-shell .stat-card:hover,
.ui-shell .shop-item:hover,
.ui-shell .download-card:hover {
    border-color: rgba(45, 212, 191, 0.28);
    box-shadow: 0 18px 45px rgba(2, 8, 23, 0.2);
    transform: translateY(-4px);
}

.ui-shell .stat-icon,
.ui-shell .action-icon {
    color: var(--ui-accent);
    border: 1px solid rgba(45, 212, 191, 0.12);
    background: rgba(45, 212, 191, 0.09);
}

.ui-shell .content-card-header {
    border-bottom-color: var(--ui-line);
}

.ui-shell .content-card-header h3 i,
.ui-shell .header-left h1 i {
    color: var(--ui-accent);
}

.ui-shell .action-item {
    border-color: var(--ui-line);
    border-radius: 14px;
}

.ui-shell .action-item:hover {
    border-color: rgba(45, 212, 191, 0.24);
    background: rgba(45, 212, 191, 0.055);
    transform: translateX(4px);
}

.ui-shell .user-balance {
    padding: 14px 18px;
    border: 1px solid rgba(244, 187, 98, 0.18);
    border-radius: var(--ui-radius);
    background: linear-gradient(110deg, rgba(244, 187, 98, 0.1), rgba(45, 212, 191, 0.05));
}

.ui-shell .balance-item i,
.ui-shell .price-tag i {
    color: var(--ui-gold);
}

.ui-shell .shop-grid {
    gap: 20px;
}

.ui-shell .shop-item {
    padding: 22px;
}

.ui-shell .item-icon {
    border: 1px solid var(--ui-line);
    border-radius: 16px;
}

.ui-shell .buy-btn,
.ui-shell .btn-confirm,
.ui-shell .download-btn,
.ui-shell .btn-primary {
    border: 0;
    border-radius: 11px;
    color: #05231f;
    background: linear-gradient(135deg, #48dfcc, #18ad9d);
    box-shadow: 0 9px 22px rgba(15, 159, 145, 0.18);
}

.ui-shell .buy-btn:hover,
.ui-shell .btn-confirm:hover,
.ui-shell .download-btn:hover,
.ui-shell .btn-primary:hover {
    box-shadow: 0 13px 28px rgba(15, 159, 145, 0.28);
    transform: translateY(-2px);
}

.ui-shell input,
.ui-shell select,
.ui-shell textarea,
.ui-shell .filter-group select {
    min-height: 46px;
    border: 1px solid var(--ui-line);
    border-radius: 11px;
    color: var(--text-primary);
    background: #f8fafc;
}

.ui-shell input:focus,
.ui-shell select:focus,
.ui-shell textarea:focus {
    border-color: var(--ui-accent);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, .1);
}

.ui-shell .modal,
.ui-shell .confirm-dialog {
    background: rgba(2, 8, 23, 0.72);
    backdrop-filter: blur(8px);
}

.ui-shell .modal-content,
.ui-shell .confirm-content {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 22px;
    background: var(--card-bg);
    box-shadow: 0 30px 90px rgba(2, 8, 23, .48);
}

.ui-shell .history-table,
.ui-shell table {
    overflow: hidden;
    border-radius: 14px;
}

.ui-shell .history-table thead,
.ui-shell table thead {
    background: rgba(45, 212, 191, 0.08);
}

.ui-shell .history-table th,
.ui-shell table th {
    color: var(--ui-accent);
    border-color: var(--ui-line);
    font-size: 12px;
    letter-spacing: .04em;
}

.ui-shell .history-table td,
.ui-shell table td {
    border-color: var(--ui-line);
}

.ui-shell .hero-section {
    overflow: hidden;
    border: 1px solid rgba(45, 212, 191, .2);
    border-radius: var(--ui-radius-lg);
    background:
        radial-gradient(circle at 85% 15%, rgba(244, 187, 98, .28), transparent 26%),
        linear-gradient(135deg, #0c8f83, #12314a) !important;
    box-shadow: 0 20px 60px rgba(2, 8, 23, .22);
}

/* Standalone utility pages */
body.ui-standalone {
    min-height: 100vh;
    padding: 32px 20px;
    color: #172033;
    background:
        radial-gradient(circle at 10% 10%, rgba(45, 212, 191, .16), transparent 30%),
        #f2f7f8 !important;
}

.ui-standalone > .container {
    max-width: 1180px !important;
}

.ui-standalone .header,
.ui-standalone .card {
    border: 1px solid rgba(15, 159, 145, .1);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-soft);
}

.ui-standalone .card-header,
.ui-standalone .header {
    background: linear-gradient(120deg, #0c8f83, #12314a);
}

.ui-standalone table thead,
.ui-standalone .table th {
    color: #08766c;
    background: #e7f6f3;
}

.ui-standalone .stats-card {
    min-height: 154px;
    border: 1px solid rgba(15, 159, 145, .1);
    border-radius: 16px;
}

/* Administration */
body.ui-admin-login {
    background:
        radial-gradient(circle at 20% 15%, rgba(45, 212, 191, .18), transparent 30%),
        radial-gradient(circle at 82% 85%, rgba(244, 187, 98, .12), transparent 28%),
        linear-gradient(145deg, #06101d, #10283c) !important;
}

.ui-admin-login .login-box {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 26px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 30px 90px rgba(2, 8, 23, .42);
}

.ui-admin-login .login-logo {
    color: #05231f;
    background: linear-gradient(145deg, #5eead4, #1aac9b);
    box-shadow: 0 12px 30px rgba(15, 159, 145, .25);
}

.ui-admin-login .btn-login {
    color: #05231f;
    background: linear-gradient(135deg, #48dfcc, #18ad9d);
    box-shadow: 0 10px 25px rgba(15, 159, 145, .23);
}

.ui-admin-login .form-control:focus {
    border-color: var(--ui-accent);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, .12);
}

body.ui-admin {
    color: #172033;
    background: #f1f6f7 !important;
}

.ui-admin .sidebar {
    background:
        radial-gradient(circle at 10% 0%, rgba(45, 212, 191, .14), transparent 24%),
        linear-gradient(180deg, #0d1b2d, #081522);
    box-shadow: 12px 0 38px rgba(2, 8, 23, .12);
}

.ui-admin .sidebar-brand h4 i,
.ui-admin .stats-icon.giftcode,
.ui-admin .stats-icon.shop {
    color: #05231f;
    background: linear-gradient(145deg, #5eead4, #1aac9b);
}

.ui-admin .sidebar a,
.ui-admin .sidebar .nav-link {
    margin: 3px 0;
    border: 1px solid transparent;
    border-radius: 10px;
}

.ui-admin .sidebar a:hover,
.ui-admin .sidebar a.active,
.ui-admin .sidebar .nav-link:hover,
.ui-admin .sidebar .nav-link.active {
    border-color: rgba(45, 212, 191, .16);
    color: #d8fffa;
    background: rgba(45, 212, 191, .1);
}

.ui-admin .page-header,
.ui-admin .stats-card,
.ui-admin .card {
    border: 1px solid rgba(15, 159, 145, .1);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(25, 53, 72, .08);
}

.ui-admin .stats-card:hover {
    border-color: rgba(15, 159, 145, .22);
    box-shadow: 0 16px 36px rgba(25, 53, 72, .12);
}

.ui-admin .page-title i {
    background: none;
    color: var(--ui-accent-strong);
    -webkit-text-fill-color: currentColor;
}

.ui-admin .btn-primary {
    border-color: #0f9f91;
    color: #05231f;
    background: linear-gradient(135deg, #48dfcc, #18ad9d);
}

.ui-admin .form-control:focus,
.ui-admin .form-select:focus {
    border-color: var(--ui-accent);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, .1);
}

/* Motion and responsive behavior */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 980px) {
    .ui-shell .sidebar {
        width: 82px;
        padding: 18px 9px;
    }

    .ui-shell .sidebar-header {
        min-height: 56px;
        padding: 0 5px 16px;
    }

    .ui-shell .sidebar-header img {
        max-width: 58px !important;
    }

    .ui-shell .sidebar-header h1,
    .ui-shell .sidebar-header p,
    .ui-shell .user-profile,
    .ui-shell .nav-item span {
        display: none;
    }

    .ui-shell .nav-item {
        justify-content: center;
        padding: 12px 8px;
    }

    .ui-shell .nav-item i {
        width: auto;
        font-size: 17px;
    }

    .ui-shell .nav-item:hover {
        transform: translateY(-2px);
    }

    .ui-shell .main-content {
        margin-left: 82px;
        padding: 22px 18px 38px;
    }
}

@media (max-width: 640px) {
    body.ui-auth {
        align-items: flex-start;
        padding: 76px 14px 28px;
    }

    .ui-auth .card-body {
        padding: 24px 20px;
    }

    .ui-auth .card-header {
        padding: 28px 20px 25px;
    }

    .ui-auth .form-grid,
    .ui-auth .method-selector {
        grid-template-columns: 1fr;
    }

    .ui-shell .sidebar {
        top: auto;
        right: 10px;
        bottom: 10px;
        left: 10px;
        z-index: 900;
        width: auto;
        height: 68px;
        padding: 8px;
        overflow: visible;
        border: 1px solid var(--ui-line);
        border-radius: 20px;
        box-shadow: 0 18px 55px rgba(2, 8, 23, .35);
    }

    .ui-shell .sidebar-header,
    .ui-shell .user-profile,
    .ui-shell .nav-separator {
        display: none;
    }

    .ui-shell .nav-menu {
        display: flex;
        height: 100%;
        gap: 4px;
        padding: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .ui-shell .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .ui-shell .nav-item {
        flex: 0 0 50px;
        width: 50px;
        min-height: 50px;
        margin: 0;
        border-radius: 14px;
    }

    .ui-shell .nav-item.active {
        box-shadow: inset 0 -3px 0 var(--ui-accent);
    }

    .ui-shell .main-content {
        margin-left: 0;
        padding: 14px 12px 96px;
    }

    .ui-shell .top-bar,
    .ui-shell .page-header {
        align-items: flex-start;
        padding: 15px;
    }

    .ui-shell .top-actions,
    .ui-shell .header-right {
        gap: 7px;
    }

    .ui-shell .top-actions .btn-danger {
        width: 44px;
        min-width: 44px;
        padding: 0;
        font-size: 0;
    }

    .ui-shell .top-actions .btn-danger i {
        margin: 0;
        font-size: 15px;
    }

    .ui-shell .stats-grid,
    .ui-shell .content-grid,
    .ui-shell .shop-grid,
    .ui-shell .download-grid,
    .ui-shell .requirements-grid {
        grid-template-columns: 1fr !important;
    }

    .ui-shell .modal-content,
    .ui-shell .confirm-content {
        width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    body.ui-standalone {
        padding: 18px 10px;
    }
}
