/* ==========================================================================
   weareqr.cc - Global Design System & Premium CSS
   Aesthetics: Sleek Dark Mode, Glowing Gradients, Glassmorphism & Micro-animations
   ========================================================================== */

/* --- Custom Variables & Tokens --- */
:root {
    --bg: #090D16;
    --sidebar-bg: #0F1524;
    --card-bg: rgba(21, 28, 48, 0.5);
    --card-hover-bg: rgba(28, 37, 62, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --primary: #3B82F6;
    --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
    --primary-glow: rgba(59, 130, 246, 0.35);
    
    --accent: #D946EF;
    --accent-gradient: linear-gradient(135deg, #F43F5E 0%, #D946EF 100%);
    
    --success: #10B981;
    --success-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
    
    --warning: #F59E0B;
    --danger: #EF4444;
    
    --text: #F3F4F6;
    --text-muted: #9CA3AF;
    --text-dark: #111827;
    
    --font-display: 'Outfit', sans-serif;
    --font-sans: 'Inter', sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: #FFFFFF;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Main Layout Grid --- */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* --- Ambient Glow Dots --- */
.ambient-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0) 70%);
    top: -100px;
    right: -100px;
    z-index: 0;
    pointer-events: none;
    filter: blur(80px);
}
.ambient-glow-2 {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.05) 0%, rgba(217, 70, 239, 0) 70%);
    bottom: -150px;
    left: -100px;
    z-index: 0;
    pointer-events: none;
    filter: blur(100px);
}

/* --- Sidebar Navigation --- */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    flex-shrink: 0;
    z-index: 100;
    height: 100vh;
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    text-decoration: none;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #FFFFFF 30%, #9CA3AF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

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

.nav-item a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 14px;
    font-weight: 600;
    font-family: var(--font-display);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item a i {
    font-size: 1.1rem;
    transition: transform var(--transition-fast);
}

.nav-item a:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item a:hover i {
    transform: translateX(3px);
}

.nav-item.active a {
    color: #FFFFFF;
    background: var(--primary-gradient);
    box-shadow: 0 10px 25px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
}

.sidebar-footer span {
    color: var(--primary);
    font-weight: 600;
}

/* --- Main Content Area --- */
.main-content {
    flex-grow: 1;
    padding: 40px 60px;
    z-index: 10;
    overflow-y: auto;
    max-width: calc(100% - 280px);
}

.section-header {
    margin-bottom: 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- General Premium Cards (Glassmorphism) --- */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 30px;
    backdrop-filter: blur(16px);
    transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--border-hover);
    background-color: var(--card-hover-bg);
}

/* --- Dashboard Dashboard Metrics / Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.metric-icon.blue {
    background: var(--primary-gradient);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.metric-icon.pink {
    background: var(--accent-gradient);
    box-shadow: 0 8px 20px rgba(217, 70, 239, 0.3);
}

.metric-icon.green {
    background: var(--success-gradient);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.metric-content {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: #FFFFFF;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 4px;
}

/* --- Dashboard list layout & components --- */
.dashboard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.search-wrapper {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px 12px 44px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* --- Premium Dynamic Table --- */
.table-responsive {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.premium-table th {
    background: rgba(15, 21, 36, 0.8);
    padding: 16px 20px;
    font-family: var(--font-display);
    font-weight: 700;
    color: #FFFFFF;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.premium-table td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #E5E7EB;
    vertical-align: middle;
    transition: background-color var(--transition-fast);
}

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

.premium-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.qr-info-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qr-name {
    font-weight: 600;
    color: #FFFFFF;
}

.qr-token-badge {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--primary);
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
}

.badge.blue {
    background: rgba(59, 130, 246, 0.12);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge.pink {
    background: rgba(217, 70, 239, 0.12);
    color: #F472B6;
    border: 1px solid rgba(217, 70, 239, 0.2);
}

.badge.green {
    background: rgba(16, 185, 129, 0.12);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* --- Table Action Buttons --- */
.actions-cell {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-icon:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-icon.edit:hover {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.btn-icon.delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* --- Generator Section Layout --- */
.generator-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    align-items: start;
}

/* --- Tabs Styling --- */
.tab-container {
    display: flex;
    background: rgba(15, 21, 36, 0.6);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.tab-btn {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: #FFFFFF;
}

.tab-btn.active {
    color: #FFFFFF;
    background: var(--primary-gradient);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.25);
}

/* --- Forms & Controls --- */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    background: rgba(15, 21, 36, 0.4);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: rgba(15, 21, 36, 0.6);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* --- Interactive Primary Button --- */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 16px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 20px var(--primary-glow);
    transition: all var(--transition-normal);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* --- QR Preview Box & Phone Shell --- */
.preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 40px;
}

.phone-shell {
    width: 320px;
    height: 380px;
    background: #FFFFFF; /* El marco de la previsualización completo con fondo blanco */
    border: 8px solid rgba(255, 255, 255, 0.1);
    border-radius: 42px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5),
                inset 0 0 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: visible; /* Evita que el contenedor del shell recorte el QR */
}

.phone-shell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 18px;
    background: #000000; /* Notch negro en contraste con el fondo blanco del mockup */
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 10;
}

.qr-wrapper {
    background: transparent; /* Eliminado el recuadro blanco flotante */
    border-radius: 0;
    box-shadow: none; /* Eliminada la sombra intermedia */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 250px;
    height: 250px;
    overflow: visible; /* SÚPER CRÍTICO: Elimina cortes en los bordes de los puntos del QR */
    margin: auto;
    left: -5px; /* Desplaza el código QR 5px hacia la izquierda para un balance óptico perfecto */
}

.qr-wrapper > div {
    width: 100% !important;
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important; /* Evita cortes internos */
}

.qr-wrapper svg,
.qr-wrapper canvas {
    max-width: 90% !important; /* Ocupa el marco cómodamente sin pegarse a los bordes */
    max-height: 90% !important;
    width: 90% !important;
    height: 90% !important;
    object-fit: contain !important;
    margin: auto !important;
    display: block;
    overflow: visible !important; /* Garantiza que se dibuje completo */
}

/* Fallback loader inside QR */
.qr-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    text-align: center;
    gap: 12px;
}

.qr-placeholder i {
    font-size: 2.5rem;
    color: var(--primary);
    animation: pulse 2s infinite;
}

.qr-placeholder span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4B5563;
}

.preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: #FFFFFF;
    border-radius: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* --- QR Code Customization Panel --- */
.customize-card {
    width: 100%;
}

.accordion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 18px 0;
}

.accordion-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.accordion-item:first-child {
    padding-top: 0;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.accordion-title {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
}

.accordion-title i {
    color: var(--primary);
}

.accordion-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    display: none;
    padding-top: 16px;
}

.accordion-header.active + .accordion-body {
    display: block;
}

/* Custom design selections */
.design-selector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.design-option {
    border: 1px solid var(--border);
    background: rgba(15, 21, 36, 0.4);
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.design-option:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
}

.design-option.active {
    border-color: var(--primary);
    color: #FFFFFF;
    background: rgba(59, 130, 246, 0.1);
}

/* Color fields styling */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.color-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.color-preview input[type="color"] {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    border: none;
    background: none;
}

/* File Upload Field */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border);
    background: rgba(15, 21, 36, 0.3);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.02);
}

.file-upload-wrapper i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.file-upload-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.file-upload-text span {
    color: #FFFFFF;
    font-weight: 600;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.logo-info-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
}

.logo-name {
    color: #FFFFFF;
    font-weight: 600;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove-logo {
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
}

/* --- Premium Modal Shell --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
    transform: translateY(30px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 1.4rem;
    font-family: var(--font-display);
    font-weight: 800;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: #FFFFFF;
}

.modal-body {
    padding: 30px;
}

/* --- Notifications System --- */
.notification-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.notification {
    background: rgba(15, 21, 36, 0.9);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    color: #FFFFFF;
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    max-width: 380px;
    transform: translateX(100px);
    opacity: 0;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.success i {
    color: var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.error i {
    color: var(--danger);
}

/* --- SPA View management classes --- */
.view-panel {
    display: none;
    animation: fadeIn var(--transition-slow) forwards;
}

.view-panel.active {
    display: block;
}

/* --- Animations definitions --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* --- Responsive Adaptations --- */
@media (max-width: 1100px) {
    .generator-layout {
        grid-template-columns: 1fr;
    }
    .preview-box {
        position: static;
    }
    .phone-shell {
        width: 100%;
        max-width: 380px;
        height: auto;
        aspect-ratio: 1 / 1.1;
    }
}

@media (max-width: 850px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        position: static;
    }
    .brand {
        margin-bottom: 24px;
        justify-content: center;
    }
    .nav-menu {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    .main-content {
        max-width: 100%;
        padding: 30px 20px;
    }
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .design-selector-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Billing Section & Pricing Cards Styles --- */
.plan-card-premium {
    background: rgba(22, 28, 45, 0.6) !important;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal) !important;
}

.plan-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(217, 70, 239, 0.12),
                0 0 30px rgba(217, 70, 239, 0.05);
    border-color: rgba(217, 70, 239, 0.5) !important;
}

/* Membership Badges */
.badge.purple {
    background: rgba(168, 85, 247, 0.12) !important;
    color: #C084FC !important;
    border: 1px solid rgba(168, 85, 247, 0.25) !important;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
    animation: goldGlow 3s infinite ease-in-out;
}

@keyframes goldGlow {
    0% { box-shadow: 0 0 5px rgba(168, 85, 247, 0.2); }
    50% { box-shadow: 0 0 15px rgba(168, 85, 247, 0.4); }
    100% { box-shadow: 0 0 5px rgba(168, 85, 247, 0.2); }
}

.billing-layout {
    animation: fadeIn var(--transition-slow) forwards;
}

#paypal-button-container {
    margin-top: 15px;
    position: relative;
    z-index: 10;
}

/* Responsive Billing tweaks */
@media (max-width: 900px) {
    .billing-layout {
        grid-template-columns: 1fr !important;
    }
}

