/* style.css - Global Stylesheet for NewXUI Panel */

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

:root {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --bg: #0a0b10;
    --bg-darker: #050508;
    --text: #ffffff;
    --text-muted: #8e92a8;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-bg-hover: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(0, 242, 254, 0.4);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --success: #00e676;
    --warning: #ffb300;
    --danger: #ff1744;
    --info: #2979ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

body {
    background: var(--bg);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(79, 172, 254, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Authentication Page */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: rgba(10, 11, 16, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.auth-logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.auth-logo-img {
    max-height: 80px;
    margin-bottom: 15px;
    object-fit: contain;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

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

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -1px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 15px;
    overflow-y: auto;
    flex-grow: 1;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.menu-link i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-link:hover, .menu-item.active .menu-link {
    color: var(--text);
    background: var(--card-bg-hover);
    box-shadow: inset 3px 0 0 var(--primary);
}

.menu-link.has-submenu::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: auto;
    transition: var(--transition);
}

.menu-item.open .menu-link.has-submenu::after {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding-left: 24px;
    margin-top: 5px;
    display: none;
}

.menu-item.open .submenu {
    display: block;
}

.submenu-link {
    display: block;
    padding: 8px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.submenu-link:hover, .submenu-item.active .submenu-link {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--bg);
    margin-right: 12px;
}

.user-info-text {
    flex-grow: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--danger);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    min-width: 0;
    max-width: 100%;
}

.top-bar {
    height: 70px;
    background: rgba(10, 11, 16, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-grow: 1;
    margin-right: 15px;
}

.content-body {
    padding: 30px;
    flex-grow: 1;
    min-width: 0;
    max-width: 100%;
}

/* Utility Cards & Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
@media (max-width: 576px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}
@media (max-width: 768px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    background: var(--card-bg-hover);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Colors and states */
.primary-glow {
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary);
}
.secondary-glow {
    background: rgba(79, 172, 254, 0.1);
    color: var(--secondary);
}
.success-glow {
    background: rgba(0, 230, 118, 0.1);
    color: var(--success);
}
.warning-glow {
    background: rgba(255, 179, 0, 0.1);
    color: var(--warning);
}
.danger-glow {
    background: rgba(255, 23, 68, 0.1);
    color: var(--danger);
}
.info-glow {
    background: rgba(41, 121, 255, 0.1);
    color: var(--info);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

select.form-control option {
    background: var(--bg-darker);
    color: var(--text);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--bg);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.btn-danger:hover {
    opacity: 0.9;
    box-shadow: 0 0 15px rgba(255, 23, 68, 0.4);
}

.btn-success {
    background: var(--success);
    color: var(--bg);
}

.btn-success:hover {
    opacity: 0.9;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.4);
}

.btn-warning {
    background: var(--warning);
    color: var(--bg);
}

.btn-warning:hover {
    opacity: 0.9;
    box-shadow: 0 0 15px rgba(255, 179, 0, 0.4);
}


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

/* Tables */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    text-align: left;
}

.table th {
    padding: 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(0, 230, 118, 0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(255, 23, 68, 0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(255, 179, 0, 0.15);
    color: var(--warning);
}

.badge-info {
    background: rgba(41, 121, 255, 0.15);
    color: var(--info);
}

.badge-primary {
    background: rgba(0, 242, 254, 0.15);
    color: var(--primary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal {
    background: rgba(10, 11, 16, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow);
    transform: scale(0.9);
    transition: var(--transition);
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

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

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

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Alert element inside page */
.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.2);
    color: var(--success);
}

.alert-danger {
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid rgba(255, 23, 68, 0.2);
    color: var(--danger);
}

/* Drag and drop categories styling */
.category-list-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    cursor: grab;
    transition: var(--transition);
}

.category-list-item:hover {
    background: var(--card-bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.category-drag-handle {
    color: var(--text-muted);
    margin-right: 15px;
    cursor: grab;
}

/* Switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Quick Generator top section on dashboard */
.quick-generator-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.quick-gen-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    white-space: nowrap;
}

/* Content cards for movies/series management */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.content-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.content-thumb {
    width: 100%;
    padding-top: 140%; /* 1:1.4 aspect ratio for posters */
    background-size: cover;
    background-position: center;
    background-color: rgba(0,0,0,0.3);
    position: relative;
}

.content-actions-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.content-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.content-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.content-checkbox-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.content-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        min-width: 0;
        max-width: 100%;
    }
    .menu-toggle {
        display: block;
    }
    .page-title {
        font-size: 1.1rem;
        margin-left: 15px;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 30px 20px;
    }
    .content-body {
        padding: 15px;
    }
    .top-bar {
        padding: 0 15px;
    }
    .grid {
        grid-template-columns: 1fr;
    }
    .page-title {
        font-size: 0.95rem;
        margin-left: 10px;
    }
}

/* Responsive Table Cards for Mobile Views */
@media (max-width: 768px) {
    .responsive-table-card.layout-cards-mode table, 
    .responsive-table-card.layout-cards-mode thead, 
    .responsive-table-card.layout-cards-mode tbody, 
    .responsive-table-card.layout-cards-mode th, 
    .responsive-table-card.layout-cards-mode td, 
    .responsive-table-card.layout-cards-mode tr { 
        display: block; 
    }
    .responsive-table-card.layout-cards-mode thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    .responsive-table-card.layout-cards-mode tr { 
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        margin-bottom: 20px; 
        padding: 15px 20px;
        box-shadow: var(--shadow);
    }
    .responsive-table-card.layout-cards-mode tr:hover {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.15);
    }
    .responsive-table-card.layout-cards-mode td { 
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04); 
        position: relative;
        padding: 12px 0;
        text-align: right;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.9rem;
    }
    .responsive-table-card.layout-cards-mode td:last-child {
        border-bottom: none;
        justify-content: flex-end;
    }
    .responsive-table-card.layout-cards-mode td:before { 
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.72rem;
        letter-spacing: 0.5px;
        text-align: left;
        margin-right: 15px;
    }
}

/* Hide helper class */
.d-none {
    display: none !important;
}
