/**
 * AI Dose - Main Stylesheet
 */

/* === Background Animation Canvas === */
#ai-bg-wrap {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}
#ai-bg-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
[data-theme="light"] #ai-bg-wrap {
    opacity: 0.45;
}

/* === Variables === */
:root {
    --bg: #171a2c;
    --bg-card: #1f2238;
    --bg-card-hover: #282b45;
    --bg-secondary: #1c1f34;
    --font-main: 'Inter', 'Onest', sans-serif;
    --text: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #6366f1;
    --accent-hover: #5558e3;
    --accent-soft: rgba(99, 102, 241, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --bg: #f5f6fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f1f5;
    --bg-secondary: #ecedf2;
    --text: #1a1a2e;
    --text-secondary: #374151;
    --text-muted: #4b5563;
    --accent: #6366f1;
    --accent-hover: #5558e3;
    --accent-soft: rgba(99, 102, 241, 0.1);
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .nav {
    background: transparent;
    border-color: transparent;
    border-bottom-color: rgba(0, 0, 0, 0.06);
    box-shadow: none;
}

[data-theme="light"] .logo {
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .theme-toggle {
    color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .theme-toggle:hover {
    color: rgba(0, 0, 0, 0.72);
}

[data-theme="light"] .nav-divider {
    display: none;
}

[data-theme="light"] .nav-link {
    color: rgba(0, 0, 0, 0.60);
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .btn-secondary {
    color: #4b5563;
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .btn-secondary:hover {
    color: #1a1a2e;
}

[data-theme="light"] .nav .btn {
    color: rgba(0, 0, 0, 0.60);
}

[data-theme="light"] .nav .btn:hover {
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .nav .btn-primary {
    color: rgba(0, 0, 0, 0.7);
    border-bottom-color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .nav .btn-primary:hover {
    color: rgba(0, 0, 0, 0.95);
    border-bottom-color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .nav-mobile {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .nav-mobile a {
    color: #4b5563;
}

[data-theme="light"] .share-modal {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .error-message {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

[data-theme="light"] .success-message {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.2);
    color: #059669;
}

.theme-toggle {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: rgba(255, 255, 255, 0.6);
}

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

body {
    font-family: var(--font-main, 'Inter'), 'Onest', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; }

/* === Layout === */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Navigation === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    z-index: 100;
    padding: 14px 32px;
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
}

.logo {
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.85);
    justify-self: start;
}

.nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.nav-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.12);
}

.nav-link {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    font-size: 0.85rem;
    padding: 0;
    border-radius: 0;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active { color: rgba(255, 255, 255, 0.8); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user-name {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
}

[data-theme="light"] .nav-user-name {
    color: rgba(0, 0, 0, 0.60);
}

.nav-user-logout {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-user-logout:hover {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .nav-user-logout {
    color: rgba(0, 0, 0, 0.50);
}

[data-theme="light"] .nav-user-logout:hover {
    color: rgba(0, 0, 0, 0.7);
}

.nav-mobile-user {
    padding: 12px 16px;
    background: var(--accent-soft);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    margin-bottom: 4px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-mobile {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    z-index: 99;
}

.nav-mobile.show { display: flex; }

.nav-mobile a {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    color: var(--text-secondary);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: #10b981;
    color: white;
}

.btn-primary:hover {
    filter: none;
    transform: none;
    background: #059669;
}

.btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.18);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.btn-secondary:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav .btn {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.2s;
}

.nav .btn:hover {
    filter: none;
    transform: none;
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: none;
}

.nav .btn-primary {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 2px;
}

.nav .btn-primary:hover {
    color: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.6);
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

/* === Footer === */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    margin-top: 80px;
    background: transparent;
}

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

.footer-logo {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

[data-theme="light"] .footer-logo {
    color: rgba(0, 0, 0, 0.85);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    font-weight: 400;
    transition: color 0.2s;
}

[data-theme="light"] .footer-links a {
    color: rgba(0, 0, 0, 0.60);
}

.footer-links a:hover {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .footer-links a:hover {
    color: rgba(0, 0, 0, 0.8);
}

.footer-text {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    text-align: center;
}

[data-theme="light"] .footer-text {
    color: rgba(0, 0, 0, 0.45);
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s;
}

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

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

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

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

/* === Messages === */
.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.success-message {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* === Section === */
.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 12px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 550px;
    margin: 0 auto;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--success);
    padding: 16px 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* === Cookie Banner === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    z-index: 9999;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
}

.cookie-content a {
    color: var(--accent);
}

/* === Checkbox Label === */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-label a {
    color: var(--accent);
}

/* === Footer Legal === */
.footer-legal {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    text-decoration: none;
    transition: color 0.2s;
}

[data-theme="light"] .footer-legal a {
    color: rgba(0, 0, 0, 0.45);
}

.footer-legal a:hover {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .footer-legal a:hover {
    color: rgba(0, 0, 0, 0.72);
}

/* === Share Modal === */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-modal.active { display: flex; }

.share-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.share-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
}

.share-modal-close:hover { color: var(--text); }
.share-modal-icon { font-size: 3rem; margin-bottom: 16px; }
.share-modal-content h2 { font-size: 1.5rem; margin-bottom: 8px; }
.share-modal-content > p { color: var(--text-secondary); margin-bottom: 24px; }

.share-rewards { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; }
.share-reward { background: var(--bg); padding: 16px 24px; border-radius: var(--radius); border: 1px solid var(--border); }
.reward-value { display: block; font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.reward-text { font-size: 0.8rem; color: var(--text-muted); }

.share-link-box { display: flex; gap: 12px; margin-bottom: 24px; }
.share-link-box input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; color: var(--text); font-size: 0.9rem; }

.share-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: all 0.2s; }
.share-telegram { background: #0088cc; color: white; }
.share-whatsapp { background: #25d366; color: white; }
.share-vk { background: #4a76a8; color: white; }
.share-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }

.share-stats { color: var(--text-muted); font-size: 0.9rem; padding-top: 16px; border-top: 1px solid var(--border); }
.share-stats strong { color: var(--accent); }

.footer-share-btn { background: none; border: none; color: var(--text-secondary); font-size: 0.9rem; cursor: pointer; font-family: inherit; }
.footer-share-btn:hover { color: var(--accent); }

button.nav-link { background: none; border: none; cursor: pointer; font-family: inherit; font-size: inherit; }

/* === Gift Modal === */
.gift-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gift-modal.active {
    display: flex;
}

.gift-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 36px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.gift-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gift-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.gift-modal-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 12px;
}

.gift-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.gift-modal-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.gift-modal-content h2 {
    font-size: 1.5rem;
    margin: 0 0 8px;
    text-align: center;
}

.gift-modal-content > p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.gift-modal-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.gift-modal-plan-card {
    cursor: pointer;
}

.gift-modal-plan-card input[type="radio"] {
    display: none;
}

.gift-modal-plan {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}

.gift-modal-plan-card input:checked + .gift-modal-plan {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.gift-modal-plan-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 10px;
    border-radius: 6px;
}

.gift-modal-plan-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.gift-modal-plan h3 {
    font-size: 0.9rem;
    margin: 0 0 4px;
}

.gift-modal-plan-period {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.gift-modal-plan-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.gift-modal-plan-save {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
}

.gift-modal-plan p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 8px 0 0;
}

.gift-modal-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

.gift-modal-form .form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

[data-theme="light"] .gift-modal-content {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .gift-modal-close {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .gift-modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav { padding: 12px 16px; grid-template-columns: 1fr auto; }
    .nav-links { display: none; }
    .nav-right { display: none; }
    .nav-user { display: none; }
    .nav-mobile-toggle { display: block; }
    
    .section { padding: 60px 0; }
    .section-title { font-size: 1.8rem; }
    
    .footer-content { flex-direction: column; gap: 16px; text-align: center; }
    .footer-links { justify-content: center; flex-wrap: wrap; }
    .footer-legal { flex-direction: column; gap: 8px; }
    
    .container { padding: 0 16px; }
    
    .cookie-content { flex-direction: column; text-align: center; }
    
    .share-modal-content { padding: 24px; }
    .share-rewards { flex-direction: column; }
    .share-link-box { flex-direction: column; }
    .share-buttons { flex-direction: column; }

    .gift-modal-plans { grid-template-columns: 1fr; }
    .gift-modal-content { padding: 24px; }
}
