* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page {
    display: none;
    width: 100%;
    animation: fadeIn 0.5s ease-in;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: #718096;
    font-size: 16px;
    line-height: 1.5;
}

.auth-tabs {
    display: flex;
    background: #f7fafc;
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 30px;
    gap: 5px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #718096;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 600;
    font-size: 14px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    color: #2d3748;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: #f56565;
    background: #fff5f5;
}

.form-input.success {
    border-color: #48bb78;
    background: #f0fff4;
}

.show-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.show-password:hover {
    opacity: 1;
}

.error-message {
    color: #f56565;
    font-size: 13px;
    margin-top: 6px;
    display: none;
    font-weight: 500;
}

.success-message {
    color: #48bb78;
    font-size: 13px;
    margin-top: 6px;
    display: none;
    font-weight: 500;
}

.password-strength {
    margin-top: 10px;
    display: none;
}

.strength-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak { background: #f56565; width: 25%; }
.strength-medium { background: #ed8936; width: 50%; }
.strength-strong { background: #48bb78; width: 75%; }
.strength-very-strong { background: #38b2ac; width: 100%; }

.strength-text {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hint-text {
    font-size: 12px;
    color: #718096;
    margin-top: 6px;
}

.forgot-password-link {
    text-align: right;
    margin-top: -10px;
    margin-bottom: 15px;
}

.forgot-password-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-password-link a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.back-to-login {
    text-align: center;
    margin-top: 20px;
}

.back-to-login a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.back-to-login a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Email Verification Styles */
.email-verification-card {
    text-align: center;
}

.email-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-radius: 20px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.verification-code-input {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 30px 0;
}

.code-digit {
    width: 50px;
    height: 60px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.3s;
    color: #2d3748;
}

.code-digit:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.code-digit.error {
    border-color: #f56565;
    background: #fff5f5;
}

.resend-timer {
    font-size: 14px;
    color: #718096;
    margin-top: 20px;
}

.resend-link {
    color: #667eea;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.resend-link:hover {
    text-decoration: underline;
}

.resend-link.disabled {
    color: #cbd5e0;
    cursor: not-allowed;
    pointer-events: none;
}

.verified-email {
    font-weight: 600;
    color: #667eea;
}

/* Gmail Inbox Styles */
.gmail-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

.gmail-header {
    background: #f8fafc;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.gmail-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
}

.gmail-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ea4335, #fbbc04);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.gmail-actions {
    display: flex;
    gap: 10px;
}

.inbox-title {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.email-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.email-item.unread {
    background: #f0f4ff;
    border-color: #667eea;
}

.email-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.email-sender {
    font-weight: 700;
    color: #2d3748;
    font-size: 15px;
}

.email-time {
    font-size: 13px;
    color: #718096;
}

.email-subject {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 4px;
    font-size: 14px;
}

.email-preview {
    color: #718096;
    font-size: 13px;
    line-height: 1.4;
}

.email-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.email-detail {
    display: none;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
}

.email-detail.active {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.email-detail-header {
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.email-detail-sender {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.email-detail-subject {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 8px;
}

.email-detail-time {
    font-size: 13px;
    color: #718096;
}

.email-detail-body {
    color: #2d3748;
    line-height: 1.8;
    font-size: 15px;
}

.verification-code-box {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    margin: 30px 0;
}

.verification-code-label {
    font-size: 14px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.verification-code-display {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 8px;
    margin: 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.verification-code-copy {
    margin-top: 16px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.verification-code-copy:hover {
    background: white;
    color: #667eea;
}

.empty-inbox {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-inbox-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-inbox-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-inbox-subtext {
    font-size: 14px;
}

/* Dashboard Styles */
.dashboard {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f7fafc;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
}

.user-role {
    font-size: 13px;
    color: #718096;
}

.credit-banner {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.credit-banner.low {
    background: linear-gradient(135deg, #f56565, #fc8181);
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.credit-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.credit-icon {
    font-size: 40px;
}

.credit-details h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 5px;
}

.credit-amount {
    color: white;
    font-size: 32px;
    font-weight: 700;
}

.credit-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.recharge-btn {
    padding: 12px 24px;
    background: white;
    color: #f59e0b;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.recharge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.stat-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 24px;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.content-card {
    background: #f7fafc;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
}

.card-content {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.8;
}

.profile-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.profile-info h2 {
    font-size: 24px;
    color: #2d3748;
    margin-bottom: 5px;
}

.profile-info p {
    color: #718096;
    font-size: 14px;
}

.profile-item {
    padding: 15px;
    background: white;
    border-radius: 12px;
}

.profile-item-label {
    font-size: 12px;
    color: #718096;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 600;
}

.profile-item-value {
    font-size: 16px;
    color: #2d3748;
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
    border: none;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.modal-subtitle {
    color: #718096;
    font-size: 14px;
}

.recharge-option {
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recharge-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.recharge-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.recharge-amount {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.recharge-price {
    font-size: 14px;
    color: #718096;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    transform: translateX(400px);
    transition: all 0.4s ease;
    z-index: 1100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #48bb78, #68d391);
}

.notification.error {
    background: linear-gradient(135deg, #f56565, #fc8181);
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.notification.info {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.admin-table-container {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
}

.table-header {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.search-box {
    max-width: 250px;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.search-box:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.admin-table {
    width: 100%;
    margin-bottom: 0;
}

.admin-table thead {
    background: #f7fafc;
}

.admin-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    color: #2d3748;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f7fafc;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.status-badge, .role-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.role-admin {
    background: #fef3c7;
    color: #92400e;
}

.role-user {
    background: #dbeafe;
    color: #1e40af;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.icon-btn {
    padding: 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    background: #f7fafc;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: #e2e8f0;
    transform: scale(1.1);
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-screen.hidden {
    display: none;
}

.loader-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .auth-card, .dashboard, .modal-content, .gmail-container {
        padding: 25px 20px;
    }

    .dashboard-title {
        font-size: 24px;
    }

    .search-box {
        max-width: 100%;
    }

    .notification {
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }

    .credit-banner {
        flex-direction: column;
        text-align: center;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .code-digit {
        width: 42px;
        height: 52px;
        font-size: 20px;
    }

    .gmail-header {
        flex-direction: column;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .table-responsive {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 900px;
    }
}