/* ========================================
   GPT Checkout Generator - Premium Design
   ======================================== */

:root {
    /* Color Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a26;

    --text-primary: #f0f0f5;
    --text-secondary: #9898b0;
    --text-muted: #5a5a78;

    --accent-primary: #7c5cfc;
    --accent-secondary: #5c8afc;
    --accent-glow: rgba(124, 92, 252, 0.3);
    --accent-gradient: linear-gradient(135deg, #7c5cfc 0%, #5c8afc 50%, #5cfcb4 100%);
    --accent-gradient-2: linear-gradient(135deg, #7c5cfc 0%, #5c8afc 100%);

    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(124, 92, 252, 0.3);

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

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(124, 92, 252, 0.15);

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

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Background Particles */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(1);
    }
}

/* App Container */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
    padding-bottom: 40px;
}

/* Header */
.header {
    position: relative;
    padding: 48px 0 32px;
    text-align: center;
    overflow: hidden;
}

.header-glow {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(124, 92, 252, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.header-content {
    position: relative;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient-2);
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: var(--shadow-glow), 0 4px 16px rgba(124, 92, 252, 0.3);
    animation: logoBreath 4s ease-in-out infinite;
}

@keyframes logoBreath {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-glow), 0 4px 16px rgba(124, 92, 252, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(124, 92, 252, 0.25), 0 4px 24px rgba(124, 92, 252, 0.4); }
}

.logo-text h1 {
    font-size: 28px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-text p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    margin-top: 4px;
}

/* Stats Row */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 20px 28px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Section */
.section {
    animation: fadeInUp 0.6s ease backwards;
}

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

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

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-primary);
    background: rgba(124, 92, 252, 0.1);
    border: 1px solid rgba(124, 92, 252, 0.2);
    border-radius: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.plan-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.plan-card.selected {
    border-color: var(--accent-primary);
    background: rgba(124, 92, 252, 0.05);
    box-shadow: var(--shadow-glow);
}

.plan-card.selected::before {
    opacity: 1;
}

.plan-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-primary);
    background: rgba(124, 92, 252, 0.12);
    border-radius: 6px;
}

.plan-badge.pro {
    color: #5cfcb4;
    background: rgba(92, 252, 180, 0.12);
}

.plan-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 92, 252, 0.08);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    margin-bottom: 16px;
    transition: all var(--transition-normal);
}

.plan-card:hover .plan-icon,
.plan-card.selected .plan-icon {
    background: rgba(124, 92, 252, 0.15);
    transform: scale(1.05);
}

.plan-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.plan-region {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-secondary);
    margin-bottom: 2px;
}

.plan-type {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.plan-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.plan-features li svg {
    color: var(--success);
    flex-shrink: 0;
}

/* Input Card */
.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.input-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(92, 138, 252, 0.06);
    border: 1px solid rgba(92, 138, 252, 0.12);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.input-hint svg {
    color: var(--accent-secondary);
    flex-shrink: 0;
    margin-top: 2px;
}

.input-hint a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.input-hint a:hover {
    border-color: var(--accent-secondary);
}

/* Textarea */
.textarea-wrapper {
    position: relative;
    margin-bottom: 16px;
}

#sessionInput {
    width: 100%;
    padding: 16px;
    padding-right: 52px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

#sessionInput::placeholder {
    color: var(--text-muted);
}

#sessionInput:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.paste-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--accent-gradient-2);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

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

.generate-btn:hover:not(:disabled)::before {
    left: 100%;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(124, 92, 252, 0.4);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-content,
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Result Section */
.result-section {
    animation: fadeInUp 0.4s ease !important;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
}

.result-card.success {
    border-color: rgba(52, 211, 153, 0.2);
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.04) 0%, var(--bg-card) 100%);
}

.result-card.error {
    border-color: rgba(248, 113, 113, 0.2);
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.04) 0%, var(--bg-card) 100%);
}

.result-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: iconPop 0.5s ease backwards;
    animation-delay: 0.1s;
}

@keyframes iconPop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    background: var(--success-bg);
    color: var(--success);
}

.error-icon {
    background: var(--error-bg);
    color: var(--error);
}

.result-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.result-card.success h3 {
    color: var(--success);
}

.result-card.error h3 {
    color: var(--error);
}

.result-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Link Display */
.link-display {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.link-display input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 13px;
    outline: none;
    min-width: 0;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.copy-btn:hover {
    background: rgba(124, 92, 252, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.copy-btn.copied {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

/* Open Link Button */
.open-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-gradient-2);
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.open-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(124, 92, 252, 0.4);
}

/* Footer */
.footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.footer-content {
    text-align: center;
}

.footer-brand {
    margin-bottom: 24px;
}

.footer-powered {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-name {
    font-size: 14px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 4px;
}

.footer-support {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    margin: 0 auto;
}

.footer-support h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-support p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f87171, #fb923c);
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.donate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(248, 113, 113, 0.3);
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 640px) {
    .app-container {
        padding: 0 16px;
        padding-bottom: 32px;
    }

    .header {
        padding: 32px 0 24px;
    }

    .logo-text h1 {
        font-size: 22px;
    }

    .stats-row {
        gap: 20px;
        padding: 16px 20px;
    }

    .stat-number {
        font-size: 18px;
    }

    .plans-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .plan-card {
        padding: 20px 16px;
    }

    .input-card {
        padding: 16px;
    }

    .link-display {
        flex-direction: column;
    }

    .section-header h2 {
        font-size: 16px;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Selection */
::selection {
    background: rgba(124, 92, 252, 0.3);
    color: white;
}
