/* Admin Panel CSS - Kube Media */
:root {
    --primary-dark: #0a0a0a;
    --secondary-dark: #1a1a1a;
    --accent-blue: #4facfe;
    --text-white: #ffffff;
    --text-gray: #b0b0b0;
    --text-light-gray: #e0e0e0;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.05);
    --hover-bg: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: var(--text-white);
    min-height: 100vh;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container { max-width: 400px; width: 100%; padding: 2rem; }

.login-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.login-logo { height: 40px; margin-bottom: 1rem; }

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--accent-blue), #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: 400;
}

.form-group { margin-bottom: 1.5rem; }
.form-group label { 
    display: block; 
    margin-bottom: 0.5rem; 
    font-weight: 500;
    color: var(--text-light-gray);
    font-size: 0.9rem;
}
.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 0.95rem;
    font-weight: 400;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.btn-login {
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(45deg, var(--accent-blue), #00f2fe);
    border: none;
    border-radius: 8px;
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

/* Dashboard */
.dashboard-page { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--secondary-dark);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-header { 
    padding: 1.5rem; 
    text-align: center; 
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo { height: 32px; margin-bottom: 0.5rem; }

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light-gray);
    letter-spacing: -0.01em;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--hover-bg);
    color: var(--text-light-gray);
    border-left-color: var(--accent-blue);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(79, 172, 254, 0.15), transparent);
    color: var(--text-white);
    border-left-color: var(--accent-blue);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.badge {
    background: #ef4444;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
}

.user-info i {
    font-size: 1.5rem;
    color: var(--accent-blue);
}

.logout-btn {
    color: var(--text-gray);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: var(--hover-bg);
    color: #ef4444;
    transform: scale(1.05);
}

.logout-btn i {
    font-size: 1.1rem;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

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

.header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-primary, .btn-refresh {
    background: linear-gradient(45deg, var(--accent-blue), #00f2fe);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover, .btn-refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

/* TV Guide */
.tv-guide {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
}

.tv-guide::-webkit-scrollbar {
    height: 8px;
}

.tv-guide::-webkit-scrollbar-track {
    background: var(--secondary-dark);
    border-radius: 4px;
}

.tv-guide::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--accent-blue), #00f2fe);
    border-radius: 4px;
}

.tv-guide::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #00f2fe, var(--accent-blue));
}

.tv-guide-container {
    min-width: 4000px;
    width: max-content;
}

.tv-guide-scroll-hint {
    text-align: center;
    padding: 0.5rem;
    color: var(--text-gray);
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--secondary-dark);
    border-top: 1px solid var(--border-color);
}

.tv-guide-scroll-hint i {
    margin-right: 0.5rem;
    color: var(--accent-blue);
}

.time-header {
    display: grid;
    grid-template-columns: 200px repeat(96, 1fr);
    background: var(--secondary-dark);
}

.time-slot {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-right: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light-gray);
}

.channel-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    border-bottom: 1px solid var(--border-color);
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--secondary-dark);
    border-right: 1px solid var(--border-color);
}

.channel-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.channel-logo.unicenter { background: linear-gradient(45deg, #ff6b6b, #ee5a6f); }
.channel-logo.tom { background: linear-gradient(45deg, #4ecdc4, #44a08d); }
.channel-logo.dot { background: linear-gradient(45deg, #45b7d1, #96c93d); }
.channel-logo.aeropuerto { background: linear-gradient(45deg, #f093fb, #f5576c); }
.channel-logo.universidad { background: linear-gradient(45deg, #4facfe, #00f2fe); }

.program-grid {
    display: grid;
    grid-template-columns: repeat(96, 1fr);
    gap: 1px;
    background: var(--border-color);
}

.program {
    padding: 1rem;
    border-right: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    min-height: 100px;
}

.program:hover { background: rgba(255, 255, 255, 0.08); }

.program-time { font-size: 0.75rem; color: var(--accent-blue); margin-bottom: 0.5rem; }
.program-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; }
.program-client { font-size: 0.75rem; color: var(--text-gray); }

/* Tables and other styles */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--secondary-dark); padding: 1rem; text-align: left; }
.data-table td { padding: 1rem; border-bottom: 1px solid var(--border-color); }

.client-info { display: flex; align-items: center; gap: 0.75rem; }
.client-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--accent-blue), #00f2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status.active { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.status.pending { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

.approval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.approval-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

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

.ad-preview { 
    display: flex; 
    gap: 1.25rem; 
    padding: 1.5rem; 
    align-items: flex-start;
}
.card-actions { display: flex; gap: 1rem; padding: 1.5rem; }

.btn-approve, .btn-reject {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-approve { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.btn-reject { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Enhanced styles for tables and cards */
.program-time { 
    font-size: 0.75rem; 
    color: var(--accent-blue); 
    margin-bottom: 0.5rem; 
    font-weight: 600;
}

.program-title { 
    font-size: 0.9rem; 
    font-weight: 600; 
    margin-bottom: 0.25rem; 
    line-height: 1.3;
}

.program-client { 
    font-size: 0.75rem; 
    color: var(--text-gray); 
    font-weight: 500;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.filter-select {
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    cursor: pointer;
    font-size: 0.9rem;
}

.data-table tr:hover {
    background: var(--hover-bg);
}

.client-info div span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-gray);
    font-weight: 400;
}

.count-badge {
    background: linear-gradient(45deg, var(--accent-blue), #00f2fe);
    color: var(--text-white);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-icon {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.btn-icon:hover {
    background: var(--hover-bg);
    color: var(--text-white);
    transform: scale(1.05);
}

.priority {
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority.urgent { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.priority.normal { background: rgba(79, 172, 254, 0.2); color: var(--accent-blue); }
.priority.low { background: rgba(107, 114, 128, 0.2); color: var(--text-gray); }

.preview-placeholder {
    width: 120px;
    height: 90px;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.5rem;
    text-align: center;
    line-height: 1.2;
}

.preview-placeholder i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.preview-placeholder p {
    margin: 0;
    word-break: break-all;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: var(--text-light-gray);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.ad-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.scheduling {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scheduling span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-gray);
    font-weight: 500;
}

.scheduling i {
    color: var(--accent-blue);
    width: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-icon.online { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.stat-icon.offline { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.stat-icon.maintenance { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.stat-icon.total { background: rgba(79, 172, 254, 0.2); color: var(--accent-blue); }

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-content p {
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.device-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.device-card:hover {
    transform: translateY(-2px);
}

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

.device-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.device-status.online { color: #10b981; }
.device-status.offline { color: #ef4444; }
.device-status.maintenance { color: #f59e0b; }

.device-info {
    padding: 1.5rem;
}

.device-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.device-specs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.device-specs span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-gray);
    font-weight: 500;
}

.device-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.metric {
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
}

.metric-value.error {
    color: #ef4444;
}

.section-header {
    margin: 3rem 0 1.5rem 0;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: -0.01em;
}

.stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-item strong {
    color: var(--text-white);
    margin-right: 0.25rem;
    font-weight: 600;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.btn-page {
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-page:hover {
    background: var(--hover-bg);
    color: var(--text-white);
}

.btn-page.active {
    background: linear-gradient(45deg, var(--accent-blue), #00f2fe);
    color: var(--text-white);
}

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

.modal-content {
    position: relative;
    background-color: var(--background-color);
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #f1f1f1;
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
}

.media-container {
    display: none;
    text-align: center;
}

.media-container.active {
    display: block;
}

.media-container img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.media-container iframe {
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: 450px;
}

/* Clickable filename styles */
.media-filename {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin: 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(26, 115, 232, 0.1);
    border: 1px solid rgba(26, 115, 232, 0.2);
}

.media-filename:hover {
    color: var(--accent-color);
    background: rgba(26, 115, 232, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 115, 232, 0.2);
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; padding: 1rem; }
    
    .tv-guide {
        overflow-x: auto;
    }
    

    
    .approval-grid, .devices-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        margin: 5% auto;
        max-width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .media-container iframe {
        height: 300px;
    }
}
