/* DocBuddy Mini App - Unique Design System */

:root {
    /* Main palette - Warm coral & ocean teal */
    --accent-primary: #FF6B6B;
    --accent-secondary: #4ECDC4;
    --accent-tertiary: #FFE66D;
    
    /* Backgrounds - Dark Theme (default) */
    --bg-primary: #0F0F1A;
    --bg-secondary: #1A1A2E;
    --bg-card: #252540;
    --bg-card-hover: #2D2D4A;
    
    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Format colors */
    --pdf-color: #FF6B6B;
    --word-color: #4A90D9;
    --excel-color: #2ECC71;
    --photo-color: #9B59B6;
    --ocr-color: #F39C12;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    --gradient-secondary: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    --gradient-premium: linear-gradient(135deg, #FFE66D 0%, #FFB347 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(255, 107, 107, 0.3);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #F5F7FA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F0F2F5;
    
    --text-primary: #1A1A2E;
    --text-secondary: rgba(26, 26, 46, 0.7);
    --text-muted: rgba(26, 26, 46, 0.4);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .floating-shape {
    opacity: 0.15;
}

[data-theme="light"] .grid-overlay {
    background-image: 
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
}

[data-theme="light"] .tool-card {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .usage-card,
[data-theme="light"] .modal-content {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .premium-features {
    background: var(--bg-primary);
}

[data-theme="light"] .premium-features li {
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .price-option {
    background: var(--bg-primary);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .upload-zone {
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .upgrade-btn {
    border-color: rgba(255, 107, 107, 0.4);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* App Container */
.app {
    position: relative;
    min-height: 100vh;
    padding: var(--space-md);
    padding-bottom: 100px;
}

/* Animated Background */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--accent-primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 250px;
    height: 250px;
    background: var(--accent-secondary);
    bottom: 20%;
    left: -80px;
    animation-delay: -7s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--accent-tertiary);
    bottom: -50px;
    right: 20%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.1); }
    50% { transform: translate(-10px, 20px) scale(0.95); }
    75% { transform: translate(30px, 10px) scale(1.05); }
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 44px;
    height: 44px;
    color: var(--accent-primary);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: -2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .theme-toggle {
    border-color: rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--bg-card-hover);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    font-size: 1.2rem;
    position: absolute;
    transition: all 0.3s ease;
}

.theme-icon.sun {
    opacity: 0;
    transform: translateY(20px) rotate(-90deg);
}

.theme-icon.moon {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

[data-theme="light"] .theme-icon.sun {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

[data-theme="light"] .theme-icon.moon {
    opacity: 0;
    transform: translateY(-20px) rotate(90deg);
}

.premium-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--gradient-premium);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 230, 109, 0.3);
}

.premium-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 230, 109, 0.4);
}

.premium-badge:active {
    transform: scale(0.98);
}

.premium-icon {
    font-size: 1rem;
}

.premium-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bg-primary);
    letter-spacing: 0.5px;
}

/* Usage Card */
.usage-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideUp 0.5s ease-out 0.1s backwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.usage-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.usage-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.usage-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
}

.usage-count .current {
    color: var(--accent-primary);
}

.usage-count .separator {
    color: var(--text-muted);
    margin: 0 2px;
}

.usage-count .total {
    color: var(--text-secondary);
}

.usage-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.usage-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.upgrade-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px dashed rgba(255, 107, 107, 0.5);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    border-style: solid;
}

.upgrade-btn svg {
    transition: transform 0.3s ease;
}

.upgrade-btn:hover svg {
    transform: translateX(4px);
}

/* Navigation */
.main-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.nav-section {
    animation: slideUp 0.5s ease-out backwards;
}

.nav-section:nth-child(1) { animation-delay: 0.2s; }
.nav-section:nth-child(2) { animation-delay: 0.3s; }
.nav-section:nth-child(3) { animation-delay: 0.4s; }

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.section-icon {
    font-size: 1.2rem;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.tools-grid.ocr-grid,
.tools-grid.photo-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Horizontal card style for photo section */
.tool-card.horizontal {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: var(--space-md);
    padding: var(--space-md);
}

.tool-card.horizontal .tool-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.tool-card.horizontal .tool-icon svg {
    width: 36px;
    height: 36px;
}

.tool-card.horizontal .tool-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.tool-card.horizontal .tool-name {
    text-align: left;
}

.tool-card.horizontal .tool-formats {
    text-align: left;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card:active {
    transform: scale(0.98);
}

.tool-card.wide {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
}

/* Featured card style */
.tool-card.featured {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.15) 0%, rgba(68, 160, 141, 0.1) 100%);
    border-color: rgba(78, 205, 196, 0.3);
}

.tool-card.featured::before {
    background: var(--gradient-secondary);
}

.tool-card.featured:hover {
    border-color: rgba(78, 205, 196, 0.5);
    box-shadow: 0 4px 20px rgba(78, 205, 196, 0.2);
}

.tool-card.wide .tool-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tool-icon {
    width: 48px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tool-icon svg {
    width: 32px;
    height: 32px;
}

/* File icon SVG styles */
.tool-icon.converter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.file-icon-svg {
    width: 28px;
    height: 35px;
    flex-shrink: 0;
}

.file-icon-svg svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.arrow-convert {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Legacy format badges */
.tool-icon .format-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.tool-icon .arrow-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    margin: 0 2px;
}

/* Tool icon colors */
.tool-icon.pdf { color: var(--pdf-color); }
.tool-icon.word { color: var(--word-color); }
.tool-icon.excel { color: var(--excel-color); }
.tool-icon.merge { color: var(--accent-secondary); }
.tool-icon.split { color: var(--accent-primary); }
.tool-icon.compress { color: var(--accent-tertiary); }
.tool-icon.photo { color: var(--photo-color); }
.tool-icon.compress-photo { color: var(--accent-secondary); }
.tool-icon.scan { color: var(--accent-secondary); }
.tool-icon.ocr { color: var(--ocr-color); }
.tool-icon.handwriting { color: var(--accent-primary); }
.tool-icon.table-ocr { color: var(--excel-color); }
.tool-icon.translate { color: var(--accent-secondary); }
.tool-icon.ai-tool { color: var(--photo-color); }

.ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 5px;
    background: var(--gradient-premium);
    color: var(--bg-primary);
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.ai-badge.small {
    font-size: 0.5rem;
    padding: 1px 4px;
}

.tool-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
}

.tool-formats {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
}

.tool-formats.premium-feature {
    color: var(--accent-tertiary);
}

.tool-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Bottom CTA */
.bottom-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    background: linear-gradient(to top, var(--bg-primary) 0%, var(--bg-primary) 80%, transparent 100%);
    padding-top: var(--space-xl);
    z-index: 10;
}

.bottom-cta::before {
    content: '';
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.bottom-cta > * {
    position: relative;
}

.bottom-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cta-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-left: var(--space-sm);
}

.cta-emoji {
    font-size: 1.5rem;
}

.cta-text {
    display: flex;
    flex-direction: column;
}

.cta-text strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.cta-text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cta-button {
    padding: var(--space-sm) var(--space-lg);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    margin-right: var(--space-sm);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.cta-button:active {
    transform: scale(0.98);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    pointer-events: auto;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-lg);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

/* Upload Zone */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: var(--bg-card);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: var(--space-lg);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(255, 107, 107, 0.1);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.file-preview.hidden {
    display: none;
}

.file-icon {
    font-size: 2rem;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

.file-remove:hover {
    color: var(--accent-primary);
}

.file-remove svg {
    width: 18px;
    height: 18px;
}

/* Progress */
.progress-container {
    margin-bottom: var(--space-lg);
}

.progress-container.hidden {
    display: none;
}

.progress-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-secondary);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-status {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

#progressText {
    color: var(--text-secondary);
}

#progressPercent {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-secondary);
}

/* Convert Button */
.convert-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.5);
}

.convert-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.convert-btn .btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Premium Modal */
.premium-content {
    text-align: center;
    padding-bottom: var(--space-xl);
}

.premium-header {
    margin-bottom: var(--space-lg);
}

.premium-icon-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-glow {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}

.premium-rocket {
    width: 64px;
    height: 64px;
    animation: rocket-float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(255, 107, 107, 0.4));
}

@keyframes rocket-float {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
}

.flame {
    animation: flame-flicker 0.15s ease-in-out infinite alternate;
    transform-origin: center top;
}

.flame-inner {
    animation-delay: 0.075s;
}

@keyframes flame-flicker {
    0% { transform: scaleY(1) scaleX(1); }
    100% { transform: scaleY(1.15) scaleX(0.9); }
}

.premium-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-premium);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
}

.premium-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.premium-features {
    list-style: none;
    text-align: left;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.premium-features li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.premium-features li:last-child {
    border-bottom: none;
}

.feature-icon {
    font-size: 1.1rem;
}

/* Pricing Options */
.pricing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.price-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.price-option:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

.price-option.selected {
    border-color: var(--accent-primary);
    background: rgba(255, 107, 107, 0.15);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

.price-option.popular.selected {
    border-color: var(--accent-tertiary);
    background: rgba(255, 230, 109, 0.25);
    box-shadow: 0 0 20px rgba(255, 230, 109, 0.3);
}

.price-option.popular .price-period {
    color: #1A1A2E;
}

.price-option.popular .price-amount {
    color: #1A1A2E;
}

.price-option.popular .price-save {
    color: #2ECC71;
}

.price-option.popular {
    border-color: rgba(255, 230, 109, 0.5);
    background: rgba(255, 230, 109, 0.1);
}

.popular-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    background: #2ECC71;
    color: #FFFFFF;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.price-period {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.price-save {
    font-size: 0.7rem;
    color: var(--accent-secondary);
    margin-top: var(--space-xs);
}

/* Payment Methods */
.payment-methods {
    margin-bottom: var(--space-md);
}

.payment-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-align: center;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.payment-option {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.payment-option:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.payment-option.selected {
    border-color: var(--accent-secondary);
    background: rgba(78, 205, 196, 0.1);
}

.payment-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.payment-icon svg {
    width: 100%;
    height: 100%;
}

.payment-icon.sbp-icon {
    background: #FFFFFF;
    padding: 6px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.payment-icon.stars-icon {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 8px;
    color: white;
    border-radius: var(--radius-md);
}

.payment-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.payment-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.payment-check {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-secondary);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.payment-option.selected .payment-check {
    opacity: 1;
    transform: scale(1);
}

/* Premium CTA Button */
.premium-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--gradient-premium);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #1A1A2E;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 230, 109, 0.4);
    margin-bottom: var(--space-md);
}

.premium-cta .cta-icon {
    font-size: 1.2rem;
}

.premium-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 230, 109, 0.5);
}

/* SBP style button */
.premium-cta.sbp-style {
    background: linear-gradient(135deg, #5B41FF 0%, #41D64F 50%, #FFCE38 100%);
    color: white;
}

.premium-cta.sbp-style .cta-icon {
    display: none;
}

.modal-close-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close-text:hover {
    color: var(--text-secondary);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Safe area for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-cta {
        padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
    }
    
    .app {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

