/* Hệ thống thiết kế CSS (Design System) cho long.tokyo */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-color: #05060d;
    --card-bg: rgba(13, 17, 33, 0.7);
    --card-border: rgba(255, 255, 255, 0.07);
    --card-border-glow: rgba(108, 92, 231, 0.3);
    
    --primary-color: #6c5ce7;
    --primary-glow: rgba(108, 92, 231, 0.5);
    --secondary-color: #00d2d3;
    --secondary-glow: rgba(0, 210, 211, 0.4);
    
    --text-main: #ffffff;
    --text-muted: #a0aec0;
    --text-dark: #4a5568;
    
    --success: #10ac84;
    --danger: #ee5253;
    
    --font-header: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(108, 92, 231, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 210, 211, 0.08) 0%, transparent 45%);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar tùy chỉnh */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* CONTAINER */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* NAVBAR */
.navbar {
    background: rgba(5, 6, 13, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
    transition: var(--transition-smooth);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-family: var(--font-header);
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 210, 211, 0.2);
}

.brand-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
    display: inline-block;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* NÚT BẤM (BUTTONS) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8c7ae6 100%);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-color);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #00b894 100%);
    color: #fff;
    box-shadow: 0 4px 15px var(--secondary-glow);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--secondary-color);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(238, 82, 83, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* THÔNG TIN USER TRÊN NAV */
.user-panel {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 6px 16px;
    border-radius: 30px;
}

.balance-badge {
    color: var(--secondary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* HERO SECTION */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero-title {
    font-family: var(--font-header);
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff 30%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* CHUYỂN TAB (TAB CONTENT) */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
    display: block;
}

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

/* CARDS GLASSMORPHISM */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: var(--card-border-glow);
    box-shadow: 0 10px 40px rgba(108, 92, 231, 0.15);
}

/* DANH SÁCH SẢN PHẨM (PRODUCT GRID) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.product-name {
    font-family: var(--font-header);
    font-size: 20px;
    font-weight: 700;
}

.stock-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.stock-available {
    background: rgba(16, 172, 132, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 172, 132, 0.2);
}

.stock-empty {
    background: rgba(238, 82, 83, 0.1);
    color: var(--danger);
    border: 1px solid rgba(238, 82, 83, 0.2);
}

.product-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 25px;
    flex-grow: 1;
}

.product-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary-color);
}

.product-price span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.buy-action {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quantity-input {
    width: 60px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #fff;
    text-align: center;
    font-weight: 600;
    outline: none;
}

/* ĐĂNG NHẬP / ĐĂNG KÝ (AUTH CARD) */
.auth-container {
    max-width: 450px;
    margin: 50px auto;
}

.auth-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--card-border);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.auth-tab.active {
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.2);
}

/* GIAO DIỆN MUA THÀNH CÔNG (SUCCESS RESULTS) */
.success-result {
    margin-top: 30px;
    display: none;
}

.success-result.active {
    display: block;
}

.result-textarea {
    width: 100%;
    height: 150px;
    background: #030408;
    border: 1px solid rgba(16, 172, 132, 0.3);
    border-radius: 12px;
    color: var(--success);
    font-family: 'Courier New', Courier, monospace;
    padding: 15px;
    font-size: 14px;
    resize: none;
    outline: none;
    margin: 15px 0;
}

/* TRA CỨU OTP (OTP LOOKUP) */
.search-container {
    max-width: 600px;
    margin: 0 auto 40px;
}

.search-box {
    display: flex;
    gap: 10px;
}

.otp-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.otp-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-smooth);
}

.otp-card:hover {
    border-color: var(--secondary-color);
    transform: translateX(5px);
}

.otp-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.otp-sender {
    font-weight: 600;
    color: var(--secondary-color);
}

.otp-badge {
    background: rgba(0, 210, 211, 0.15);
    color: var(--secondary-color);
    padding: 8px 16px;
    font-size: 20px;
    font-weight: 800;
    border-radius: 10px;
    display: inline-flex;
    align-self: flex-start;
    border: 1px solid rgba(0, 210, 211, 0.3);
    margin-top: 10px;
    letter-spacing: 2px;
}

.otp-subject {
    font-weight: 700;
    font-size: 15px;
}

.otp-body {
    color: var(--text-muted);
    font-size: 14px;
    white-space: pre-line;
}

/* LỊCH SỬ MUA HÀNG (HISTORY TABLE) */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.history-table th, .history-table td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}

.history-table td {
    font-size: 14px;
}

.history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* NOTIFICATION POPUP (Toast) */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(13, 17, 33, 0.95);
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.success {
    border-left-color: var(--success);
}

/* MODAL TỰ CỘNG TIỀN TEST */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    animation: modalSlide 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-title {
    font-family: var(--font-header);
    font-size: 20px;
    margin-bottom: 20px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    color: var(--text-main);
}
