/* ============================================
   Swapella.net - Premium Face Swap Experience
   ============================================ */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --secondary-light: #f472b6;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a24;
    --bg-input: #1e1e2a;
    --border-color: #2a2a3a;
    --border-light: #3a3a4a;

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-card: linear-gradient(145deg, #12121a 0%, #1a1a24 100%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --shadow-glow-pink: 0 0 40px rgba(236, 72, 153, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0px 24px 30px;
    position: relative;
}

/* ============================================
   Logo & Header
   ============================================ */
header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    display: flex;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-icon img {
    height: 42px;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 400;
}

/* ============================================
   Auth Header
   ============================================ */
.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.4s ease-out;
}

.auth-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-header a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.auth-header a:hover {
    color: var(--primary-light);
}

.auth-header a.btn {
    color:#fff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-balance {
    background: var(--gradient-secondary);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    animation: pulse 2s ease-in-out infinite;
    text-decoration: none;
    color: var(--text-primary) !important;
    white-space: nowrap;
}

.logout {
    margin-top: 5px;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

.user-balance strong {
    color: var(--text-primary);
}

/* ============================================
   CTA & Notice Boxes
   ============================================ */
.cta-pricing {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.5s ease-out 0.2s both;
}

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

.cta-pricing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.cta-pricing p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1rem;
}

.guest-limit-notice {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    color: var(--warning);
    margin-bottom: 24px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: shake 0.5s ease-out 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.guest-limit-notice::before {
    content: '⚠️';
    font-size: 1.2rem;
}

.guest-limit-notice a {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: underline;
}

/* ============================================
   Form Sections
   ============================================ */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
    animation: slideInUp 0.5s ease-out both;
}

.form-section:nth-child(2) { animation-delay: 0.1s; }
.form-section:nth-child(3) { animation-delay: 0.2s; }
.form-section:nth-child(4) { animation-delay: 0.3s; }

.form-section:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-normal);
}

.form-section:hover::before {
    opacity: 1;
}

.form-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    /* padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color); */
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section h2::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    /* font-weight: 600; */
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* File input */
.form-group input[type="file"] {
    width: 100%;
    padding: 20px;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.form-group input[type="file"]:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Checkbox */
.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    /* padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color); */
    transition: var(--transition-fast);
}

.checkbox-group label:hover {
    border-color: var(--primary);
}

.checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Consent section */
.consent-section {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.consent-checkbox label {
    color: var(--text-secondary);
}

/* Image preview */
.image-preview {
    margin-top: 20px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.image-preview img {
    max-width: 220px;
    max-height: 220px;
    border-radius: var(--radius-md);
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.image-preview img:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

/* ============================================
   Video Preview
   ============================================ */
.video-preview-container {
    margin-top: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.4s ease-out;
}

.video-loading {
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
    font-size: 1rem;
}

.video-loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#videoPreview {
    width: 100%;
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-md);
    background: #000;
    margin: 0 auto 20px;
    display: block;
    box-shadow: var(--shadow-lg);
}

/* Source site badge */
.source-site {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.source-site img {
    height: 28px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
}

.source-site span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   Timeline / Dual Range Slider
   ============================================ */
.timeline-container {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.time-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.time-label strong {
    color: var(--primary-light);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
}

.duration-label strong {
    color: var(--success-light);
}

.duration-label small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Dual range slider */
.dual-range-slider {
    position: relative;
    height: 32px;
    margin: 12px 0;
}

.slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
}

.slider-range {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 10px;
    background: var(--gradient-secondary);
    border-radius: 5px;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.dual-range-slider input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 32px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
}

.dual-range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: var(--primary);
    border: 4px solid var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
}

.dual-range-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.dual-range-slider input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border: 4px solid var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: var(--shadow-md);
}

.dual-range-slider input[type="range"]::-moz-range-track {
    background: transparent;
}

.dual-range-slider input#endSlider::-webkit-slider-thumb {
    background: var(--success);
}

.dual-range-slider input#endSlider::-moz-range-thumb {
    background: var(--success);
}

/* Single slider mode (for guests and users with low balance) */
.single-slider-mode #endSlider {
    display: none;
}

.single-slider-mode .end-time-label {
    display: none;
}

.single-slider-mode .max-duration-hint {
    display: none;
}

.single-slider-mode .timeline-labels {
    justify-content: space-between;
}

.timeline-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   Buttons
   ============================================ */
.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 28px;
    margin-bottom: 48px;
}

.btn {
    padding: 16px 36px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled::before {
    display: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: var(--gradient-success);
    color: var(--text-primary);
    box-shadow: var(--shadow-md), 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-accent {
    background: var(--gradient-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Result & Analysis Sections
   ============================================ */
.result-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-top: 24px;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease-out;
}

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

.result-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-info {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item .label {
    color: var(--text-muted);
    font-weight: 500;
}

.result-item .value {
    color: var(--text-primary);
    font-weight: 700;
}

.result-item .link {
    color: var(--primary-light);
    text-decoration: none;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.result-item .link:hover {
    color: var(--secondary-light);
}

/* ============================================
   Progress Section
   ============================================ */
.progress-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 24px;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease-out;
}

.progress-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 28px;
    text-align: center;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    height: 16px;
    background: var(--bg-input);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 8px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.95rem;
}

#progressPercent {
    color: var(--primary-light);
    font-weight: 700;
    font-size: 1.1rem;
}

.step-text {
    color: var(--text-secondary);
}

.status-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 16px;
}

/* Result video */
.result-video {
    width: 100%;
    max-height: 500px;
    border-radius: var(--radius-md);
    background: #000;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ============================================
   Error & Warning Boxes
   ============================================ */
.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 24px;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 14px;
}

.error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 14px;
    animation: shake 0.4s ease-out;
}

.balance-error-box {
    text-align: center;
    padding: 40px 32px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.balance-error-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.balance-error-box h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.balance-error-box p {
    margin-bottom: 28px;
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .form-section {
        padding: 20px;
    }

    .cta-pricing {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .result-item .link {
        max-width: 100%;
    }

    .auth-header {
        flex-wrap: wrap;
        justify-content: center;
        flex-direction: column;
    }
    .auth-block {
        gap: 8px !important;
        flex-direction: column-reverse;
    }

    .lang-switcher {
        gap: 4px !important;
    }

    .user-info {
        /* flex-wrap: wrap;
        justify-content: center; */
    }

    .guest-limit-notice {
        flex-direction: column;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow {
    box-shadow: var(--shadow-glow);
}

.glow-pink {
    box-shadow: var(--shadow-glow-pink);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    text-align: center;
    padding: 20px 0 20px;
    margin-top: 40px;
    /* border-top: 1px solid var(--border-color); */
    color: var(--text-muted);
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

.site-footer a:hover {
    color: var(--secondary-light);
}

/* ============================================
   Dashboard Navigation Styles
   ============================================ */
.dashboard-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    padding: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.dashboard-nav a {
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.dashboard-nav a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.dashboard-nav a.active {
    background: var(--gradient-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.history-table th,
.history-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-input);
}

.history-table th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.history-table th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.history-table td {
    color: var(--text-secondary);
}

.history-table tbody tr {
    transition: var(--transition-fast);
}

.history-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.history-table tbody tr:hover td {
    color: var(--text-primary);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.processing {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Pricing Cards */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.pricing-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
    transition: var(--transition-normal);
    position: relative;
}

.pricing-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.pricing-card.popular {
    border-color: var(--primary);
    background: linear-gradient(145deg, var(--bg-card), rgba(99, 102, 241, 0.1));
}

.pricing-card.popular::before {
    content: 'POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: var(--text-primary);
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.pricing-card .plan-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.pricing-card .plan-seconds {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.pricing-card .plan-seconds small {
    font-size: 1rem;
    -webkit-text-fill-color: var(--text-muted);
}

.pricing-card .plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0;
}

.pricing-card .plan-price small {
    font-size: 1rem;
    color: var(--text-muted);
}

.pricing-card .plan-features {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    text-align: left;
}

.pricing-card .plan-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-card .plan-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

/* Auth Forms */
.auth-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 24px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.auth-logo img {
    height: 48px;
    width: auto;
}

.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    animation: fadeInUp 0.5s ease-out;
}

.auth-box h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.auth-box .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Google Button */
.btn-google {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
}

.btn-google:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.empty-state p {
    margin-bottom: 24px;
}

/* ============================================
   Footer Links
   ============================================ */
.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-light);
}

/* ============================================
   Language Switcher
   ============================================ */
.lang-switcher {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.lang-switcher a {
    padding: 4px 8px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.lang-switcher a:hover {
    color: var(--text-primary);
    background: var(--bg-input);
}

.lang-switcher a.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
}

/* ============================================
   Policy Pages (Terms, Privacy, Refund)
   ============================================ */
.policy-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
}

.policy-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
}

.policy-content h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.policy-content .last-updated {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.policy-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 36px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.policy-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
}

.policy-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.policy-content ul,
.policy-content ol {
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-left: 24px;
}

.policy-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.policy-content strong {
    color: var(--text-primary);
}

.policy-content a {
    color: var(--primary-light);
    text-decoration: none;
}

.policy-content a:hover {
    text-decoration: underline;
}

.policy-nav {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.policy-nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    transition: var(--transition-fast);
}

.policy-nav a:hover,
.policy-nav a.active {
    background: var(--primary);
    color: var(--text-primary);
}

/* Refund page highlight box */
.refund-highlight {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin: 24px 0;
}

.refund-highlight p {
    color: var(--success);
    margin: 0;
}

/* Policy pages responsive */
@media (max-width: 768px) {
    .policy-content {
        padding: 28px 20px;
    }

    .policy-content h1 {
        font-size: 1.8rem;
    }
}

/* ============================================
   Dashboard Layout
   ============================================ */

.dashboard-layout {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 24px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header .logo-icon a {
    display: block;
}

.dashboard-header .logo-icon img {
    height: 40px;
    width: auto;
}

.dashboard-user-block {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dashboard-user-block a {
    text-decoration: none;
}

.dashboard-user-block .user-balance {
    animation: none;
}

.dashboard-user-block .dashboard-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
}

.dashboard-user-block .dashboard-link:hover {
    color: var(--primary-light);
}

.dashboard-user-block .logout-link {
    color: var(--danger);
    font-weight: 500;
}

.dashboard-user-block .logout-link:hover {
    text-decoration: underline;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.page-header .actions {
    display: flex;
    gap: 12px;
}

/* Content card */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    transition: var(--transition-normal);
}

.content-card:hover {
    border-color: var(--border-light);
}

.content-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-input);
}

.data-table th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.data-table td {
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:hover td {
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Dashboard responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .dashboard-user-block {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .page-header .actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}
