@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;600;700;800&display=swap');

:root {
    /* PlayOn Brand Colors */
    --brand-navy: #f8fafc; /* Re-purposed to very light gray for bg */
    --brand-deep-blue: #1e3a8a;
    --brand-light-blue: #0ea5e9;
    --brand-orange: #f59e0b;
    --brand-neon-blue: #0284c7; /* Darker blue for light theme contrast */
    
    /* System Colors (Light Theme) */
    --bg-main: var(--brand-navy);
    --bg-card: #ffffff; /* Clean white cards */
    --bg-glass: rgba(255, 255, 255, 0.85); /* Light glass */
    --border-color: rgba(0, 0, 0, 0.08); /* Soft dark border */
    --border-glow: rgba(14, 165, 233, 0.2);
    
    /* Accents */
    --primary: var(--brand-light-blue);
    --primary-hover: var(--brand-neon-blue);
    --secondary: #6366f1;
    --accent: var(--brand-orange);
    --success: #10b981;
    --danger: #ef4444;
    --warning: var(--brand-orange);
    
    /* Typography (Light Theme) */
    --text-main: #0f172a; /* Dark slate text */
    --text-muted: #64748b; /* Slate gray muted text */
}

body.dark-mode {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Alexandria', 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

.dashboard-container {
    max-width: 1250px !important;
    margin: 0 auto;
    padding: 50px 20px;
    z-index: 1;
    position: relative;
}

/* ===== Typography ===== */
h1, h2, h3, h4, strong {
    font-family: 'Alexandria', sans-serif;
}

/* ===== Header Styling (Dual-Tone Dark) ===== */
.platform-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: var(--po-white);
    padding: 60px 40px;
    text-align: center;
    border-radius: 24px;
    margin-bottom: 50px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.platform-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-light-blue), var(--brand-orange));
}

/* Subtle Glowing Orb Behind Logo (Dark Mode style for contrast) */
.platform-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(245, 158, 11, 0.1) 50%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(30px);
}

.platform-header img, .platform-header h1, .platform-header p, .platform-header div {
    position: relative;
    z-index: 2;
}

.platform-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0 0 12px 0;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.platform-header p {
    color: #cbd5e1; /* Light slate text for readability on dark BG */
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

/* ===== Summary Cards View ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.summary-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
    border-top-color: var(--brand-light-blue);
}

.summary-card:hover::before {
    left: 150%;
}

.summary-card h3 {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-card .value {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
}

/* Status Specific Cards */
.card-expired { border-top-color: var(--danger); }
.card-expired .value { color: #dc2626; }

.card-warning { border-top-color: var(--warning); }
.card-warning .value { color: #d97706; }

.card-accent { border-top-color: var(--success); }
.card-accent .value { color: #059669; }

.card-trial { border-top-color: #9333ea; }
.card-trial .value { color: #9333ea; }

.card-suspended { border-top-color: #e11d48 !important; }
.card-suspended .value { color: #e11d48; }

.summary-card.filter-active {
    background: rgba(14, 165, 233, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.15);
    transform: scale(1.05);
}

/* ===== Form & Settings Section ===== */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
    transition: 0.3s ease;
}

.form-section:hover {
    border-color: rgba(0, 0, 0, 0.15);
}

.form-section h2, .form-section h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 25px 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.settings-input {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Alexandria', inherit;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* Phone Input Customization */
.phone-input-group {
    display: flex; gap: 0;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    direction: ltr;
    transition: 0.3s ease;
}
.phone-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
    background: #ffffff;
}
.country-code-select {
    width: 100px;
    padding: 14px 10px;
    background: #f1f5f9;
    color: var(--text-main);
    border: none;
    border-right: 1px solid #cbd5e1;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}
.phone-input-group input {
    flex: 1; border: none; background: transparent; margin: 0; padding: 14px 18px; color: var(--text-main); font-family: 'Inter', sans-serif;
}
.phone-input-group input:focus { outline: none; }


/* ===== Buttons ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--brand-deep-blue) 0%, var(--brand-light-blue) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Alexandria', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, var(--brand-light-blue) 0%, var(--brand-neon-blue) 100%);
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.2);
}

/* ===== Interactive Academy Tenant Card ===== */
.academy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.academy-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: #e2e8f0;
}

.academy-card:hover {
    transform: translateY(-5px);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.academy-card:hover::before {
    background: linear-gradient(90deg, var(--brand-light-blue), var(--brand-orange));
}

.academy-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-main);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 8px;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.info-item span:first-child {
    color: var(--text-muted);
    font-weight: 700;
    min-width: 100px;
}

.info-item strong {
    font-weight: 700;
}

/* Badges */
.status-badge {
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-active { background: #d1fae5; color: #059669; border: 1px solid #a7f3d0; }
.status-suspended { background: #ffe4e6; color: #e11d48; border: 1px solid #fecdd3; }

/* Quick Stats Row */
.stats-container {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    border: 1px solid #e2e8f0;
}

.stat-item {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: #ffffff;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: 0.3s;
}

.stat-item:hover { background: #f1f5f9; transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.stat-item span:first-child { font-size: 0.85rem; color: var(--text-muted); font-weight: 700; }
.stat-item span:last-child { font-size: 1.5rem; font-weight: 800; color: var(--brand-neon-blue); }

/* Copy URL Box */
.url-box {
    background: #f0f9ff;
    padding: 14px 20px;
    border-radius: 12px;
    font-family: 'Inter', monospace;
    color: var(--brand-neon-blue);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 8px; cursor: pointer;
    border: 1px solid #bae6fd;
    transition: 0.3s;
}

.url-box:hover { background: #e0f2fe; box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1); }

/* Card Action Column */
.academy-actions {
    display: flex; flex-direction: column; gap: 15px;
    padding-right: 30px; border-right: 1px solid #e2e8f0;
}

/* Quick Renew Widget */
.renewal-group {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 16px;
    padding: 20px;
    margin-top: 25px;
}

.renewal-title {
    font-size: 0.95rem; color: #b45309; font-weight: 700; margin-bottom: 12px;
}

.renewal-btns {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 10px;
}

.btn-renew {
    background: #fef3c7; border: 1px solid #fcd34d;
    color: #d97706; padding: 10px; border-radius: 10px; font-weight: 700;
    transition: 0.3s; cursor: pointer; text-align: center; font-family: inherit; font-size: 0.85rem;
}
.btn-renew:hover { background: var(--brand-orange); color: white; box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2); border-color: var(--brand-orange); }

/* ===== Modals ===== */
.modal-overlay {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999; display: none; align-items: center; justify-content: center;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 24px; padding: 40px; width: 90%; max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ===== Responsive Mobile Fixes ===== */
@media (max-width: 1100px) {
    .summary-grid { grid-template-columns: repeat(3, 1fr); }
    .academy-card { grid-template-columns: 1fr; }
    .academy-actions { padding-right: 0; border-right: none; border-top: 1px solid #e2e8f0; padding-top: 25px; flex-direction: row; flex-wrap: wrap; }
    .academy-actions button, .academy-actions a { flex: 1 1 45%; }
}

@media (max-width: 768px) {
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .platform-header h1 { font-size: 1.8rem; }
    .platform-header p { font-size: 0.95rem; }
    .platform-header { padding: 30px 15px; border-radius: 16px; margin-bottom: 30px; }
    .platform-header::before { width: 300px; height: 300px; } /* Scale down abstract glow */
    .dashboard-container { padding: 20px 10px; }
    
    /* Header Buttons Fix */
    .platform-header > div { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 20px; }
    .platform-header .btn-nav, .platform-header .btn-delete { width: 100%; text-align: center; justify-content: center; }

    /* Forms & Settings Fix */
    .form-section { padding: 25px 15px; }
    .form-section h2, .form-section h3 { font-size: 1.35rem; }

    /* Academy Card Mobile View */
    .academy-card { padding: 25px 15px; display: flex; flex-direction: column; }
    .academy-info h3 { font-size: 1.3rem; flex-wrap: wrap; }
    .info-item { flex-direction: column; align-items: flex-start; gap: 5px; text-align: right; }
    .info-item span:first-child { min-width: auto; }
    
    .stats-container { grid-template-columns: 1fr 1fr; gap: 10px; padding: 15px; }
    .stat-item { padding: 10px; }
    .stat-item span:last-child { font-size: 1.2rem; }

    /* Actions and Renewal */
    .academy-actions { flex-direction: column; gap: 10px; }
    .academy-actions button, .academy-actions a { flex: 1 1 100%; width: 100%; }
    .renewal-btns { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .url-box { flex-direction: column; gap: 10px; align-items: flex-start; word-break: break-all; }
}