/* public/assets/css/style.css */

:root {
    --bg-color: #06070B; /* Deep space dark background */
    --primary: #6366F1; /* Electric Indigo */
    --primary-hover: #4F46E5; /* Deep Indigo */
    --primary-glow: rgba(99, 102, 241, 0.3);
    --accent: #06B6D4; /* Cyberpunk Cyan */
    --accent-glow: rgba(6, 182, 212, 0.2);
    --surface: rgba(16, 18, 27, 0.7); /* Obsidian semi-transparent surface */
    --sidebar-bg: rgba(10, 11, 16, 0.9);
    --surface-border: rgba(255, 255, 255, 0.05);
    --surface-border-active: rgba(99, 102, 241, 0.3);
    --text-main: #F3F4F6; /* Clean crisp white */
    --text-muted: #9CA3AF; /* Cool gray */
    --success: #10B981; /* Emerald green */
    --error: #EF4444; /* Rose red */
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1); /* Premium ease-out */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Glowing Background Blobs */
.glow-blob {
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    filter: blur(120px);
    animation: float-blob 20s ease-in-out infinite alternate;
}

.glow-blob-1 {
    top: -250px;
    left: -200px;
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(99, 102, 241, 0) 70%);
}

.glow-blob-2 {
    bottom: -350px;
    right: -250px;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(6, 182, 212, 0) 70%);
    animation-delay: -10s;
}

@keyframes float-blob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.15); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* -------------------------------------------------------------
   Layout Structure & Containers
   ------------------------------------------------------------- */
.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    margin: 12vh auto;
    z-index: 10;
    position: relative;
}

.auth-card {
    background: var(--surface);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 48px 36px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dashboard-layout {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

.dashboard-layout.active {
    display: flex;
}

/* -------------------------------------------------------------
   Sidebar Panel
   ------------------------------------------------------------- */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 36px 28px;
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.sidebar-brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFFFFF, #9CA3AF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    flex: 1;
    padding: 28px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sidebar-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.25);
}

.sidebar-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 24px 20px;
    border-top: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: white;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
}

.sidebar-username {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------
   Main Content Area
   ------------------------------------------------------------- */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.content-section {
    animation: fadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.section-header {
    margin-bottom: 8px;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* -------------------------------------------------------------
   Stats Widget Cards
   ------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.stat-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--surface-border-active);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.15);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 30px;
    font-weight: 800;
    color: #fff;
}

.stat-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: var(--primary);
    transition: var(--transition-smooth);
}

.stat-card:hover .stat-icon-box {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--accent);
}

/* -------------------------------------------------------------
   Forms & Inputs
   ------------------------------------------------------------- */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-input {
    width: 100%;
    background: rgba(10, 11, 16, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 14px;
    transition: var(--transition-smooth);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
    background: rgba(6, 7, 11, 0.85);
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: none;
    transform: none;
}

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

.btn-block {
    width: 100%;
}

.toggle-link {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-muted);
}

.toggle-link a {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s ease;
}

.toggle-link a:hover {
    color: var(--accent);
}

/* -------------------------------------------------------------
   Obsidian Panel Cards
   ------------------------------------------------------------- */
.panel-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
}

@media (max-width: 1024px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
}

.panel-card {
    background: var(--surface);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.panel-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Apps Grid Cards */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.app-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.app-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.15);
}

.app-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-card-icon {
    width: 44px;
    height: 44px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: var(--primary);
}

.app-card-info {
    min-width: 0;
}

.app-card-name {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.app-card-id {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.app-card-version {
    font-weight: 700;
    color: var(--accent);
    background: rgba(6, 182, 212, 0.06);
    border: 1px solid rgba(6, 182, 212, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 48px 0;
    width: 100%;
}

/* Category Collapsible Block Accordion */
.category-block {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.category-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.category-block-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.category-block-title-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.category-block-title {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.category-block-slug {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.category-block-content {
    display: none;
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(0, 0, 0, 0.15);
}

.category-block-content.active {
    display: block;
}

/* Radio Station Items */
.radio-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: var(--transition-smooth);
}

.radio-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.radio-item-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.radio-item-img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

.radio-item-text {
    min-width: 0;
}

.radio-item-title {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.radio-item-url {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------
   Media Library Grid & Deletes
   ------------------------------------------------------------- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
}

.media-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.media-item:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(6, 182, 212, 0.2);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    padding: 12px;
    font-size: 11px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-item:hover .media-item-overlay {
    opacity: 1;
}

.media-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.85);
    border: none;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 5;
}

.media-item:hover .media-item-delete {
    opacity: 1;
}

.media-item-delete:hover {
    background: var(--error);
    transform: scale(1.1);
}

/* -------------------------------------------------------------
   Modals
   ------------------------------------------------------------- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: rgba(15, 17, 24, 0.95);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 36px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    animation: modalSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: var(--text-muted);
    transition: color 0.2s ease;
    line-height: 1;
}

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

.advanced-trigger {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    margin: 14px 0;
    display: inline-block;
    transition: color 0.2s ease;
}

.advanced-trigger:hover {
    color: var(--accent);
}

.advanced-fields {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 18px;
    margin-top: 8px;
}

.advanced-fields.active {
    display: block;
}

.back-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
    transition: color 0.2s ease;
}

.back-nav:hover {
    color: var(--primary);
}

/* -------------------------------------------------------------
   Toaster Notifications & Alerts
   ------------------------------------------------------------- */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: rgba(15, 17, 24, 0.95);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateY(-50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

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

/* Spinner */
.spinner {
    border: 2.5px solid rgba(255, 255, 255, 0.15);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border-left-color: white;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
