/* style.css - CSS cho toàn bộ hệ thống */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* ====== LOGIN PAGE ====== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 28px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f0f0f0;
    color: #666;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.form-content {
    display: none;
}

.form-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-admin {
    background: #764ba2;
    color: white;
}

.btn-admin:hover {
    background: #63408a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.3);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* ====== NAVBAR ====== */
.navbar {
    background: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar.admin {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
}

.navbar.admin h2 {
    color: white;
}

.navbar h2 {
    color: #667eea;
    font-size: 24px;
}

/* ====== CONTAINER & CARDS ====== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card.full-width {
    grid-column: 1 / -1;
}

.card h3 {
    color: #667eea;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* ====== STATS ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #667eea;
}

.stat-card.available {
    border-left-color: #10b981;
}

.stat-card.farming {
    border-left-color: #f59e0b;
}

.stat-card.completed {
    border-left-color: #8b5cf6;
}

.stat-number {
    font-size: 42px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-card.available .stat-number {
    color: #10b981;
}

.stat-card.farming .stat-number {
    color: #f59e0b;
}

.stat-card.completed .stat-number {
    color: #8b5cf6;
}

.stat-label {
    color: #666;
    font-size: 16px;
    font-weight: 600;
}

/* ====== ACCOUNT INFO ====== */
.get-account-section {
    text-align: center;
    padding: 40px 20px;
}

.available-count {
    font-size: 18px;
    color: #666;
    margin-bottom: 25px;
}

.available-count strong {
    color: #10b981;
    font-size: 24px;
}

.current-account {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
}

.account-info {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 10px;
}

.info-row .label {
    font-weight: 600;
    opacity: 0.9;
}

.info-row .value {
    font-weight: bold;
    font-size: 18px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.current-account .button-group {
    display: flex;
    gap: 10px;
}

.current-account .button-group .btn {
    flex: 1;
}

/* ====== ACCOUNT LIST ====== */
.account-list {
    max-height: 600px;
    overflow-y: auto;
}

.account-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
}

.account-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.account-item.completed {
    border-left-color: #10b981;
}

.account-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-row .label {
    color: #666;
    font-weight: 600;
    font-size: 14px;
}

.detail-row .value {
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

.detail-row .timestamp {
    color: #999;
    font-size: 14px;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 16px;
}

/* ====== HISTORY ====== */
.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.history-item.farming {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.history-item.completed {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.user-badge {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.time-badge {
    color: #666;
    font-size: 14px;
}

.history-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-info-row {
    display: flex;
    gap: 10px;
}

.account-info-row .label {
    color: #666;
    font-weight: 600;
    min-width: 100px;
}

.account-info-row .value {
    color: #333;
    font-weight: 500;
}

/* ====== NOTIFICATION ====== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

/* ====== MODAL ====== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.close {
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    opacity: 0.8;
}

.available-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.available-account-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #10b981;
    transition: all 0.3s;
}

.available-account-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.account-number {
    background: #10b981;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 18px;
}

.available-account-item .account-detail {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.available-account-item .label {
    color: #666;
    font-weight: 600;
    font-size: 13px;
}

.available-account-item .value {
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.available-account-item .value.small {
    font-size: 12px;
    color: #999;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.stat-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-weight: normal;
}

.card-header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-header-with-button h3 {
    margin: 0;
    padding: 0;
    border: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        padding: 15px 20px;
    }
    
    .navbar h2 {
        font-size: 18px;
    }
    
    .login-box {
        padding: 25px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .current-account .button-group {
        flex-direction: column;
    }
}