/* ============================================
   Royal TV automatizat - Global Styles
   ============================================ */

:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #8B83FF;
    --accent: #FF6584;
    --success: #00C853;
    --warning: #FFB300;
    --danger: #FF5252;
    --bg-dark: #0F0F1A;
    --bg-card: #1A1A2E;
    --bg-input: #16213E;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B3C5;
    --text-muted: #6C7293;
    --border: rgba(108, 99, 255, 0.2);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(108, 99, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 101, 132, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Typography
   ============================================ */

h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { line-height: 1.6; color: var(--text-secondary); }

/* ============================================
   Layout
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.page-header {
    text-align: center;
    padding: 60px 0 40px;
}

.page-header h1 {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.page-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(108, 99, 255, 0.4);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00A344);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #D32F2F);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

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

.form-input, .form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

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

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 6px;
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   Badges / Status
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
}

.badge-success { background: rgba(0, 200, 83, 0.15); color: var(--success); }
.badge-warning { background: rgba(255, 179, 0, 0.15); color: var(--warning); }
.badge-danger { background: rgba(255, 82, 82, 0.15); color: var(--danger); }
.badge-info { background: rgba(108, 99, 255, 0.15); color: var(--primary-light); }

/* ============================================
   Subscription Card
   ============================================ */

.sub-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.sub-card.principal {
    border-color: rgba(255, 165, 0, 0.5);
    border-left: 4px solid #FF9F1C;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.08), rgba(26, 26, 46, 1));
}

.sub-card.principal .sub-name {
    color: #FF9F1C;
}

.sub-card:not(.principal) {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.05), rgba(26, 26, 46, 1));
}

.sub-card:not(.principal) .sub-name {
    color: var(--primary);
    font-size: 1.05rem;
}

.sub-card:hover {
    border-color: rgba(108, 99, 255, 0.6);
    transform: translateX(4px);
}

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

.sub-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.sub-name .crown { margin-right: 6px; }

.sub-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.sub-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sub-detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sub-detail-value {
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-primary);
}

.sub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Mobile actions: hidden on desktop, shown on mobile */
.mobile-actions {
    display: none;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Mobile bottom sheet menu */
.mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.mobile-menu-sheet {
    background: var(--card-bg, #1a1a2e);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary, #fff);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text-muted, #999);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

.mobile-menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-item {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: 2px solid var(--primary, #6c63ff);
    background: transparent;
    color: var(--primary, #6c63ff);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.mobile-menu-item:disabled {
    opacity: 0.5;
}

.mobile-menu-item.btn-primary {
    background: var(--primary, #6c63ff);
    color: white;
    border-color: var(--primary, #6c63ff);
}

/* ============================================
   Pricing Grid
   ============================================ */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.pricing-card.popular::before {
    content: 'POPOLARE';
    position: absolute;
    top: 16px; right: -28px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 32px;
    transform: rotate(45deg);
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: rgba(108, 99, 255, 0.4);
}

.pricing-duration {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.pricing-commission {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.pricing-savings {
    font-size: 0.85rem;
    color: #4caf50;
    font-weight: 600;
    font-style: italic;
    margin-bottom: 20px;
}

.pricing-savings.best {
    color: #ffd700;
    font-size: 0.9rem;
}

.pricing-card.best-offer {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.pricing-info-wrapper {
    position: relative;
    margin-top: 30px;
    margin-bottom: 24px;
}

.pricing-info {
    text-align: center;
    padding: 12px 20px;
    font-size: 0.95rem;
    color: var(--text-primary);
    border: 2px solid #ffd700;
    border-radius: 10px;
    background: rgba(255, 215, 0, 0.05);
}

/* Arrow line from active toggle button to info box */
.pricing-arrow-line {
    position: absolute;
    top: -24px;
    width: 4px;
    height: 24px;
    background: #ffd700;
}

.pricing-arrow-line::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 13px solid #ffd700;
}

/* ============================================
   Type Toggle (Standard / Multivision)
   ============================================ */

.type-toggle {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.type-toggle-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 1.15rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: var(--transition);
}

.type-toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

/* ============================================
   Referral Section
   ============================================ */

.referral-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 30px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.08);
}

.referral-input-group {
    display: flex;
    gap: 12px;
    max-width: 400px;
}

/* ============================================
   Navbar
   ============================================ */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    position: relative;
    z-index: 10;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.navbar-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-links a:hover {
    color: var(--primary);
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: var(--danger);
}

.alert-info {
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.3);
    color: var(--primary-light);
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-close:hover { color: var(--text-primary); }

/* ============================================
   Table
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg-input);
    padding: 14px 16px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(108, 99, 255, 0.08);
}

tr:hover {
    background: rgba(108, 99, 255, 0.03);
}

/* ============================================
   KPI Grid
   ============================================ */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
}

/* ============================================
   Loading / Spinner
   ============================================ */

.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

.loading-text {
    text-align: center;
    color: var(--text-muted);
    margin-top: 16px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.3rem; }

    .container { padding: 0 16px; }

    .page-header { padding: 40px 0 24px; }

    .pricing-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sub-details {
        grid-template-columns: 1fr 1fr;
    }

    .desktop-actions {
        display: none !important;
    }

    .mobile-actions {
        display: block !important;
    }

    .navbar {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .pricing-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .pricing-card {
        padding: 14px 10px;
    }

    .pricing-duration {
        font-size: 0.85rem;
    }

    .pricing-price {
        font-size: 1.3rem;
    }

    .pricing-commission,
    .pricing-savings {
        font-size: 0.7rem;
    }

    .pricing-card .btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* ============================================
   Utility
   ============================================ */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: #ff4444 !important; }

/* ============================================
   CTA Split (Homepage)
   ============================================ */

.cta-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 700px;
    margin: 0 auto 40px;
}

.cta-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
}

.cta-box h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

@media (max-width: 600px) {
    .cta-split {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ============================================
   Features List (Homepage)
   ============================================ */

.hero-subtitle {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffd700;
    margin-top: 8px;
}

.features-list {
    max-width: 550px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.feature-icon {
    font-size: 1.5rem;
    min-width: 36px;
    text-align: center;
}

.feature-text {
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .features-list {
        gap: 14px;
    }
    .feature-item {
        font-size: 1rem;
    }
    .feature-icon {
        font-size: 1.3rem;
    }
}
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
