:root {
    --primary: #8a2be2;
    --primary-dark: #4a0e8f;
    --secondary: #ff1493;
    --bg-dark: #0f0c29;
    --bg-mid: #302b63;
    --bg-light: #24243e;
    --text-main: #ffffff;
    --text-muted: #b3b3b3;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --success: #2ecc71;
    --danger: #e74c3c;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-mid), var(--bg-light));
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Anti-copy protections */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

input, textarea {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

#app-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: rgba(15, 12, 41, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(to right, #e0c3fc, #8ec5fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    -webkit-text-fill-color: var(--primary);
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

main {
    flex: 1;
    padding: 40px 5%;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Home Page */
.hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 60px;
}

.hero-content {
    flex: 1;
    min-width: 300px;
}

.subtitle {
    color: var(--secondary);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.title {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #d8b4fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 30px;
}

.welcome-text {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

/* Ad Slideshow Card */
.ad-card {
    background: rgba(20, 15, 50, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 15px;
    margin-top: 30px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    height: 380px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-card img {
    width: calc(100% - 30px);
    height: calc(100% - 30px);
    border-radius: 12px;
    object-fit: contain;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
    position: absolute;
    top: 15px;
    left: 15px;
}

.ad-card img.visible {
    opacity: 1;
}

.ad-placeholder {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* Player Card */
.player-card {
    flex: 0 1 400px;
    background: rgba(20, 15, 50, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

.player-card::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: var(--primary);
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(231, 76, 60, 0.2);
    color: #ff6b6b;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.now-playing {
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
}

.now-playing h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.now-playing p {
    color: var(--text-muted);
}

/* Equalizer */
.equalizer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    height: 40px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.equalizer .bar {
    width: 8px;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 4px;
    height: 10px;
    transition: height 0.1s;
}

.equalizer.playing .bar {
    animation: eq 0.8s infinite alternate;
}

.equalizer.playing .bar:nth-child(2) { animation-delay: 0.2s; }
.equalizer.playing .bar:nth-child(3) { animation-delay: 0.4s; }
.equalizer.playing .bar:nth-child(4) { animation-delay: 0.1s; }
.equalizer.playing .bar:nth-child(5) { animation-delay: 0.3s; }

@keyframes eq {
    0% { height: 10px; }
    100% { height: 40px; }
}

/* Controls */
.controls {
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
}

.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 25px rgba(138, 43, 226, 0.4);
}

.volume-control {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--text-muted);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Schedule List */
.schedule-section h3 {
    font-family: var(--font-heading);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.schedule-list, .admin-schedule-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.schedule-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.schedule-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.time-badge {
    background: rgba(138, 43, 226, 0.2);
    color: #e0c3fc;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    min-width: 80px;
}

.prog-details h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.prog-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-actions-prog {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--text-main);
}
.icon-btn.delete:hover {
    color: var(--danger);
}

/* Auth Card and Settings Card */
.auth-card, .settings-card {
    max-width: 450px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(10px);
}

.auth-card h2, .dashboard-header h2, .settings-card h2 {
    font-family: var(--font-heading);
    margin-bottom: 10px;
}

.auth-card p, .dashboard-header p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i:first-child {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    z-index: 2;
}

input[type="text"], input[type="email"], input[type="password"], textarea, input[type="file"] {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-wrapper input {
    padding-left: 40px;
}

input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(138, 43, 226, 0.3);
}

textarea {
    resize: vertical;
}

input[type="color"] {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    cursor: pointer;
    padding: 5px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 2;
}

.form-options {
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    width: auto;
}

.error-msg, .success-msg {
    min-height: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}
.error-msg { color: var(--danger); }
.success-msg { color: var(--success); }

.form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.form-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.form-footer a:hover { color: white; }

.credential-hint {
    margin-top: 15px;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary);
}

.stat-info h3 {
    font-size: 1.8rem;
    font-family: var(--font-heading);
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}
.admin-actions button {
    width: auto;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}
@media (max-width: 900px) {
    .dashboard-panels { grid-template-columns: 1fr; }
}

.panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 12px;
}

.panel h3 {
    margin-bottom: 20px;
    font-family: var(--font-heading);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Settings Form overrides */
.settings-card {
    max-width: 600px;
    margin: 0;
}
.form-actions {
    display: flex;
    gap: 15px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-mid);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 450px;
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    position: relative;
    animation: fadeIn 0.3s;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover { color: white; }

/* Footer */
footer {
    padding: 20px 5%;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 12, 41, 0.5);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.social-links a {
    color: var(--text-muted);
    margin-left: 15px;
    font-size: 1.2rem;
    transition: color 0.3s;
}

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

@media (max-width: 768px) {
    nav { flex-direction: column; gap: 15px; padding: 15px; }
    .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
    .nav-links a { margin-left: 0; }
    
    .title { font-size: 2.5rem; }
    .hero { flex-direction: column; text-align: center; margin-bottom: 40px; }
    .player-card { width: 100%; flex: auto; padding: 30px 20px; }
    
    .schedule-list, .admin-schedule-list { grid-template-columns: 1fr; }
    
    .footer-content { flex-direction: column; gap: 15px; text-align: center; }
    .admin-actions { flex-direction: column; }
    .admin-actions button { width: 100%; }
}

@media (max-width: 480px) {
    main { padding: 25px 5%; }
    .title { font-size: 2rem; }
    .subtitle { font-size: 0.8rem; letter-spacing: 1px; margin-bottom: 5px; }
    .tagline { font-size: 1rem; margin-bottom: 20px; }
    
    .stats-grid { grid-template-columns: 1fr; }
    
    .auth-card, .settings-card, .panel, .modal-content { padding: 20px; }
    .form-actions { flex-direction: column; }
    
    .volume-control input[type="range"] { width: 100px; }
    
    .schedule-item { flex-direction: column; text-align: center; gap: 10px; padding: 15px; }
    .admin-actions-prog { margin-left: 0; justify-content: center; width: 100%; padding-top: 10px; border-top: 1px solid var(--border-color); }
}
