/**
 * Bradford College Kano Online Radio - Admin Panel Stylesheet
 * Theme: Blue, Gold, White
 */

/* ===== Import base variables ===== */
:root {
    --bc-blue: #003B8E;
    --bc-blue-light: #1a5cc7;
    --bc-blue-dark: #002a6b;
    --bc-gold: #D4A843;
    --bc-gold-light: #e8c566;
    --bc-gold-dark: #b08a30;
    --bc-white: #FFFFFF;
    --bc-light: #F8F9FA;
    --bc-dark: #1a1a2e;
    
    --primary: var(--bc-blue);
    --primary-light: var(--bc-blue-light);
    --primary-dark: var(--bc-blue-dark);
    --accent: var(--bc-gold);
    --accent-light: var(--bc-gold-light);
    --accent-dark: var(--bc-gold-dark);
    
    --status-live: #dc3545;
    --status-offline: #6c757d;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --card-radius: 12px;
    --btn-radius: 8px;
    
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    
    --shadow-sm: 0 2px 8px rgba(0, 59, 142, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 59, 142, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 59, 142, 0.18);
}

[data-bs-theme="dark"] {
    --bc-light: #1a1a2e;
    --bc-dark: #0f0f1a;
    --primary: #4a8eff;
    --primary-light: #6ba5ff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ===== Global ===== */
body {
    font-family: var(--font-body);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    line-height: 1.6;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

/* ===== Admin Layout ===== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bc-blue-dark), var(--bc-blue));
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    transition: transform var(--transition-medium);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-brand img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--bc-gold);
    margin-bottom: 0.75rem;
}

.sidebar-brand h5 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin: 0;
}

.sidebar-brand small {
    color: var(--bc-gold);
    font-size: 0.75rem;
}

.sidebar-nav {
    padding: 1rem 0;
    list-style: none;
}

.sidebar-nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    color: white;
    background: rgba(212, 168, 67, 0.15);
    border-left-color: var(--bc-gold);
}

.sidebar-nav-link i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-footer a:hover {
    color: var(--bc-gold);
}

/* ===== Main Content ===== */
.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Top Bar ===== */
.admin-topbar {
    background: var(--bs-card-bg);
    border-bottom: 1px solid rgba(0, 59, 142, 0.1);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

.topbar-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    font-size: 1.25rem;
}

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

/* ===== Stats Cards ===== */
.stat-card {
    background: var(--bs-card-bg);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 59, 142, 0.08);
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, var(--success), #2ecc71);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, var(--warning), #f39c12);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, var(--status-live), #e74c3c);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

/* ===== Control Panel ===== */
.control-panel {
    background: var(--bs-card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 59, 142, 0.08);
    overflow: hidden;
}

.control-panel-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.25rem 1.5rem;
}

.control-panel-header h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin: 0;
}

.control-panel-body {
    padding: 1.5rem;
}

/* ===== Broadcast Toggle ===== */
.broadcast-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bs-body-bg);
    border-radius: var(--card-radius);
    margin-bottom: 1.5rem;
}

.toggle-btn {
    position: relative;
    width: 60px;
    height: 30px;
    border-radius: 15px;
    background: var(--status-offline);
    border: none;
    cursor: pointer;
    transition: background var(--transition-medium);
}

.toggle-btn.active {
    background: var(--status-live);
}

.toggle-btn::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-medium);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-btn.active::after {
    transform: translateX(30px);
}

.toggle-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.toggle-label.off {
    color: var(--status-offline);
}

.toggle-label.on {
    color: var(--status-live);
}

/* ===== Action Buttons ===== */
.btn-radio {
    padding: 0.75rem 1.5rem;
    border-radius: var(--btn-radius);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-radio-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
}

.btn-radio-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-radio-success {
    background: linear-gradient(135deg, var(--success), #2ecc71);
    color: white;
    border: none;
}

.btn-radio-success:hover {
    background: linear-gradient(135deg, #157347, var(--success));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-radio-danger:hover {
    background: linear-gradient(135deg, #bb2d3b, var(--danger));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-radio-warning {
    background: linear-gradient(135deg, var(--warning), #f39c12);
    color: #000;
    border: none;
}

.btn-radio-warning:hover {
    background: linear-gradient(135deg, #e0a800, var(--warning));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== Form Controls ===== */
.form-control-radio {
    border: 2px solid rgba(0, 59, 142, 0.15);
    border-radius: var(--btn-radius);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.form-control-radio:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 59, 142, 0.15);
    outline: none;
}

.form-label-radio {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
}

/* ===== Microphone Status ===== */
.mic-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bs-body-bg);
    border-radius: var(--card-radius);
    margin-bottom: 1rem;
}

.mic-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.mic-icon.active {
    background: rgba(220, 53, 69, 0.15);
    color: var(--status-live);
    animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.mic-level {
    flex: 1;
    height: 8px;
    background: var(--bs-secondary-bg);
    border-radius: 4px;
    overflow: hidden;
}

.mic-level-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--success), var(--warning), var(--status-live));
    border-radius: 4px;
    transition: width 0.1s ease;
}

/* ===== Tables ===== */
.radio-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.radio-table thead th {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
}

.radio-table thead th:first-child {
    border-radius: var(--card-radius) 0 0 0;
}

.radio-table thead th:last-child {
    border-radius: 0 var(--card-radius) 0 0;
}

.radio-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 59, 142, 0.08);
    font-size: 0.9rem;
}

.radio-table tbody tr:hover td {
    background: rgba(0, 59, 142, 0.03);
}

/* ===== Login Page ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bc-blue-dark), var(--bc-blue), var(--bc-blue-dark));
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.login-card {
    background: var(--bs-card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--bc-gold);
    margin: 0 auto 1.5rem;
    display: block;
}

.login-title {
    font-family: var(--font-heading);
    font-weight: 800;
    text-align: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ===== Alerts ===== */
.alert-radio {
    border: none;
    border-radius: var(--btn-radius);
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
}

.alert-radio-success {
    background: rgba(25, 135, 84, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-radio-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .control-panel-body {
        padding: 1rem;
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* ===== WebRTC Preview ===== */
.webrtc-preview {
    width: 100%;
    max-width: 300px;
    height: 200px;
    background: var(--bs-dark);
    border-radius: var(--card-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 1rem auto;
    position: relative;
    overflow: hidden;
}

.webrtc-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webrtc-preview .preview-placeholder {
    text-align: center;
}

.webrtc-preview .preview-placeholder i {
    font-size: 3rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
}
