/* ==========================================================================
   Design System & Custom CSS Variables - LinkWA.ar
   ========================================================================== */

:root {
    /* Color Palette */
    --color-bg-main: #0B0F19;
    --color-bg-card: #151C2C;
    --color-bg-card-hover: #1E273A;
    --color-bg-input: #0F1623;
    
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-focus: #25D366;
    
    /* WhatsApp Theme Brand Colors */
    --color-wa-primary: #25D366;
    --color-wa-hover: #20BD5A;
    --color-wa-dark: #128C7E;
    --color-wa-deep: #075E54;
    
    /* Accent & Support Colors */
    --color-accent-blue: #3B82F6;
    --color-accent-cafecito: #FF8126;
    --color-accent-mp: #009EE3;
    
    /* Text Colors */
    --color-text-primary: #F8FAFC;
    --color-text-secondary: #94A3B8;
    --color-text-muted: #64748B;
    
    /* Functional Colors */
    --color-danger: #EF4444;
    --color-danger-hover: #DC2626;
    --color-success: #10B981;
    
    /* Typography */
    --font-family-base: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Radius & Shadows */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 25px rgba(37, 211, 102, 0.25);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Base & Reset Styles
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-base);
    background-color: var(--color-bg-main);
    background-image: 
        radial-gradient(circle at 20% 10%, rgba(37, 211, 102, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(18, 140, 126, 0.08) 0%, transparent 50%);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

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

/* ==========================================================================
   Header Component
   ========================================================================== */

.site-header {
    background: rgba(21, 28, 44, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text-primary);
}

.logo-icon-wrapper {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--color-wa-primary), var(--color-wa-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    transition: transform var(--transition-normal);
}

.brand-logo:hover .logo-icon-wrapper {
    transform: scale(1.05) rotate(-3deg);
}

.whatsapp-icon {
    width: 26px;
    height: 26px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.brand-name .highlight {
    color: var(--color-wa-primary);
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-cafecito-header {
    background: linear-gradient(135deg, #FF8126, #E06000);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 3px 12px rgba(255, 129, 38, 0.3);
    transition: all var(--transition-fast);
}

.btn-cafecito-header:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 5px 16px rgba(255, 129, 38, 0.45);
    color: #ffffff;
}

.header-badge {
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.3);
    color: var(--color-wa-primary);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.main-content {
    flex: 1;
    padding-top: 2.5rem;
    padding-bottom: 4rem;
}

.hero-section {
    max-width: 780px;
    margin: 0 auto 2.5rem auto;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff 40%, var(--color-text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* ==========================================================================
   Cards & Generator Layout Grid
   ========================================================================== */

.generator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 991px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-normal);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--color-text-primary);
}

.section-icon {
    width: 22px;
    height: 22px;
    color: var(--color-wa-primary);
}

/* ==========================================================================
   Form Controls & Inputs
   ========================================================================== */

.form-group {
    margin-bottom: 1.35rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.label-with-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-counter {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.phone-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.phone-input-wrapper:focus-within {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.country-prefix {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem 0.75rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border-right: 1px solid var(--color-border);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.country-select-control {
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    font-weight: 700;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.country-select-control option {
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    padding: 0.5rem;
}

.form-control {
    width: 100%;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.phone-control {
    border: none;
    border-radius: 0;
    background: transparent;
}

.phone-control:focus {
    box-shadow: none;
}

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

.input-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.hint-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.phone-preview-badge {
    margin-top: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: #93C5FD;
}

/* Preset Chips */
.chips-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip-btn:hover {
    background: rgba(37, 211, 102, 0.15);
    border-color: var(--color-wa-primary);
    color: var(--color-text-primary);
    transform: translateY(-1px);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 0.95rem 1.5rem;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-wa-primary), var(--color-wa-dark));
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-wa-hover), var(--color-wa-dark));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-success {
    background: var(--color-wa-primary);
    color: #ffffff;
}

.btn-success:hover {
    background: var(--color-wa-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-dark {
    background: #1E293B;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-dark:hover {
    background: #334155;
}

.btn-outline-danger {
    background: transparent;
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--color-danger);
}

.btn-outline-light {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-text-primary);
}

.btn-cafecito {
    background: linear-gradient(135deg, #FF8126, #E06000);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 129, 38, 0.3);
}

.btn-cafecito:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 129, 38, 0.4);
}

/* ==========================================================================
   Output Panel & QR Code Display
   ========================================================================== */

.output-placeholder {
    padding: 3.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.placeholder-icon-box {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
}

.placeholder-icon-box svg {
    width: 32px;
    height: 32px;
}

.placeholder-text {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    max-width: 320px;
}

.url-input {
    font-family: monospace;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    color: var(--color-wa-primary);
    font-weight: 600;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 576px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

.qr-container-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
}

.qr-frame {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.qrcode-canvas {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-canvas img,
.qrcode-canvas canvas {
    width: 180px !important;
    height: 180px !important;
    display: block;
}

.qr-caption {
    font-size: 0.75rem;
    color: #475569;
    font-weight: 600;
}

/* ==========================================================================
   History Section
   ========================================================================== */

.history-card {
    margin-bottom: 3rem;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-secondary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-history-msg {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1.5rem 0;
}

.history-item {
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: background-color var(--transition-fast);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.history-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.history-phone {
    font-weight: 700;
    color: var(--color-wa-primary);
    font-size: 0.95rem;
}

.history-msg-preview {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 450px;
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ==========================================================================
   Features Grid Section
   ========================================================================== */

.features-section {
    margin-bottom: 3.5rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 991px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* ==========================================================================
   FAQ Accordion Section
   ========================================================================== */

.faq-section {
    margin-bottom: 3.5rem;
}

.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    padding: 1.1rem 1.35rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    color: var(--color-text-primary);
    transition: background-color var(--transition-fast);
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.03);
}

.faq-answer {
    padding: 0 1.35rem 1.25rem 1.35rem;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ==========================================================================
   Support & Donation Widget Block
   ========================================================================== */

.support-card {
    background: linear-gradient(135deg, #1A2338, #111827);
    border: 1px solid rgba(255, 129, 38, 0.3);
    margin-bottom: 3rem;
}

.support-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.support-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #FFF;
    margin-bottom: 0.4rem;
}

.support-desc {
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    max-width: 750px;
}

.support-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.mp-box {
    background: rgba(0, 158, 227, 0.08);
    border: 1px solid rgba(0, 158, 227, 0.3);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    min-width: 280px;
}

.mp-logo {
    color: var(--color-accent-mp);
    font-weight: 800;
    font-size: 0.9rem;
}

.mp-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.mp-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.mp-label {
    color: var(--color-text-muted);
    font-weight: 600;
}

.mp-code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: #38BDF8;
    font-family: monospace;
    font-size: 0.85rem;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    background: #1E293B;
    color: #FFFFFF;
    border: 1px solid var(--color-wa-primary);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: auto;
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.toast-out {
    animation: toastOut 0.25s forwards;
}

.toast-icon {
    color: var(--color-wa-primary);
    font-size: 1.1rem;
}

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

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

/* ==========================================================================
   Footer Component
   ========================================================================== */

.site-footer {
    background: rgba(11, 15, 25, 0.95);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.footer-copy {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

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

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

.footer-disclaimer {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
