/* Modern CSS for Gmail Purchase Website */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --border: #e5e7eb;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-menu a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--primary);
    color: white;
}

.nav-toggle {
    display: none !important;
    position: absolute;
    opacity: 0;
    visibility: hidden;
    width: 0;
    height: 0;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.nav-toggle-label span {
    display: block;
    width: 24px;
    height: 3px;
    margin: 4px 0;
    background: var(--dark);
    border-radius: 3px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
    opacity: 0;
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar .container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-toggle-label {
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin-left: auto;
        background: rgba(99, 102, 241, 0.1);
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.25rem;
        display: none;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(0,0,0,0.05);
    }
    
    .nav-toggle:checked ~ .nav-menu {
        display: flex;
    }
    
    .nav-menu a {
        width: 100%;
        text-align: left;
        font-size: 1rem;
        padding: 0.65rem 0.75rem;
    }
    
    .page-header {
        margin-top: 1rem;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
}

.auth-card h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.auth-card h2 {
    text-align: center;
    color: var(--dark);
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    text-align: center;
    color: white;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Cards */
.card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.card h2 {
    color: var(--dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: var(--gray);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: var(--dark);
    font-size: 1.75rem;
    font-weight: bold;
}

.stat-card.stat-primary {
    border-left: 4px solid var(--primary);
}

.stat-card.stat-success {
    border-left: 4px solid var(--success);
}

.stat-card.stat-warning {
    border-left: 4px solid var(--warning);
}

.stat-card.stat-danger {
    border-left: 4px solid var(--danger);
}

.stat-card.stat-info {
    border-left: 4px solid var(--info);
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.info-box {
    background: #dbeafe;
    border-left: 4px solid var(--info);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.info-box strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--info);
}

.info-box ul {
    margin-left: 1.5rem;
    color: #1e40af;
}

.info-box code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.referral-link-box {
    margin-bottom: 1.5rem;
}

.referral-link-input {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.referral-link-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--light);
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--border);
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

table tbody tr:hover {
    background: var(--light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

/* Gmail Item */
.gmail-item {
    margin-bottom: 1.5rem;
}

.gmail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gmail-header h3 {
    color: var(--dark);
    margin: 0;
}

.gmail-details {
    background: var(--light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.gmail-details p {
    margin-bottom: 0.5rem;
}

.gmail-details code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--danger);
}

/* Inline Form */
.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form input {
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    /* Navbar responsive */
    .navbar {
        padding: 0.75rem 0;
    }

    .navbar .container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .nav-brand {
        font-size: 1.25rem;
        text-align: center;
        padding: 0.5rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
    }

    .nav-menu a {
        text-align: center;
        padding: 0.75rem 1rem;
        width: 100%;
        border-radius: 6px;
    }

    /* Page header */
    .page-header {
        margin-bottom: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header p {
        font-size: 0.95rem;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Cards */
    .card {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .card h2 {
        font-size: 1.25rem;
    }

    /* Action buttons */
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Filter buttons */
    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-buttons .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.875rem;
    }

    table th,
    table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    /* Inline forms */
    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form input,
    .inline-form button {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Gmail items */
    .gmail-item {
        margin-bottom: 1.25rem;
    }

    .gmail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .gmail-header h3 {
        font-size: 1rem;
        word-break: break-all;
    }

    .gmail-details {
        padding: 0.75rem;
    }

    .gmail-details p {
        font-size: 0.875rem;
        word-break: break-word;
    }

    /* Info box */
    .info-box {
        padding: 1rem;
        font-size: 0.875rem;
    }

    .info-box ul {
        margin-left: 1.25rem;
    }

    /* Auth card */
    .auth-card {
        padding: 1.5rem;
    }

    .auth-card h1 {
        font-size: 1.5rem;
    }

    .auth-card h2 {
        font-size: 1.25rem;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Zalo Floating Icon */
.zalo-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #0068ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
}

.zalo-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.zalo-float img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.zalo-float::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #0068ff;
    animation: zalo-pulse 1.5s infinite;
    z-index: -1;
}

@keyframes zalo-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}