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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: none;
    cursor: pointer;
}

.primary-btn {
    background: #007bff;
    color: #ffffff;
}

.primary-btn:hover {
    background: #0056b3;
}

.secondary-btn {
    background: #6c757d;
    color: #ffffff;
}

.secondary-btn:hover {
    background: #5a6268;
}

.error-message {
    color: #dc3545;
    margin-top: 10px;
}

/* Login Page Styling */
.login-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form h2 {
    margin-bottom: 25px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.login-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    margin-top: 15px;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #2c3e50; /* Dark blue/grey */
    color: #ecf0f1;
    padding: 20px;
    flex-shrink: 0;
    overflow-y: auto; /* Allow scrolling for many menu items */
}

.sidebar .logo {
    text-align: center;
    margin-bottom: 30px;
}

.sidebar .logo h3 {
    font-size: 1.5rem;
    color: #007bff; /* Highlight color */
}

.main-nav ul {
    list-style: none;
}

.main-nav ul li {
    margin-bottom: 10px;
}

.main-nav ul li a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    background-color: #34495e; /* Slightly lighter dark */
    color: #007bff; /* Highlight color */
}

.main-nav .has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav .has-submenu > a::after {
    content: '▼'; /* Unicode down arrow */
    font-size: 0.7em;
    margin-left: 10px; /* Space out arrow */
    transition: transform 0.3s ease;
}

.main-nav .has-submenu.expanded > a::after {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
    border-left: 2px solid #007bff;
    display: none; /* Hidden by default */
}

/* Show submenu when parent is expanded */
.has-submenu.expanded .submenu {
    display: block;
}

.submenu li a {
    font-size: 0.9em;
    padding: 8px 15px;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    background-color: #f4f4f4;
    overflow-y: auto; /* Allow scrolling for content */
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.dashboard-header h2 {
    color: #333;
    font-size: 1.8rem;
}

.content-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.content-section h3 {
    color: #007bff;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Overview Grid Styling */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.overview-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.overview-card h4 {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.overview-card .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #343a40;
}

.small-progress.progress-bar {
    height: 6px;
    margin-top: 10px;
}

/* Performance Grid Styling */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.performance-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.performance-card h4 {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 15px;
}

.performance-card .stat-value {
    font-size: 2.2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #28a745; /* Green for low usage */
    width: 0%; /* Will be set by JS */
    transition: width 0.5s ease-in-out, background-color 0.5s ease-in-out;
}

/* Adjust color based on usage (JS will handle this dynamically) */
.progress-fill.yellow {
    background-color: #ffc107; /* Yellow for moderate usage */
}
.progress-fill.red {
    background-color: #dc3545; /* Red for high usage */
}

/* Contacts Display Styling */
#contacts-display table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#contacts-display th,
#contacts-display td {
    padding: 10px;
    border: 1px solid #eee;
    text-align: left;
}

#contacts-display th {
    background-color: #f0f0f0;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding-bottom: 0;
    }

    .main-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav ul li {
        margin: 0 10px 10px 10px;
    }

    .main-nav ul li a {
        padding: 8px 12px;
    }

    .submenu {
        border-left: none;
        padding-left: 0;
        text-align: center;
    }

    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }

    .dashboard-header h2 {
        margin-bottom: 15px;
    }

    .overview-grid, .performance-grid {
        grid-template-columns: 1fr; /* Stack columns on small screens */
    }
}

/* Password Change Form Styling */
#password-change-content .form-group {
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

#password-change-content .btn {
    width: auto;
    margin-top: 20px;
}
.danger-btn { background: #dc3545; color: #fff; padding: 7px 12px; font-size: 0.9rem; }
.danger-btn:hover { background: #b02a37; }

/* ===== VIDEO GALLERY STYLES ===== */

/* Upload Area */
.video-upload-area {
    border: 2px dashed #007bff;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    background: #f0f7ff;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
    margin-bottom: 30px;
}

.video-upload-area:hover,
.video-upload-area.drag-over {
    background: #ddeeff;
    border-color: #0056b3;
}

.video-upload-area .upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.video-upload-area .upload-text {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
}

.video-upload-area .upload-subtext {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 12px;
}

.video-upload-area .upload-hint {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 12px;
}

.upload-label {
    cursor: pointer;
    display: inline-block;
    font-size: 0.95rem;
}

/* Videos Grid */
.videos-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 10px;
}

.videos-section .loading-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

.videos-section .no-videos-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaa;
    padding: 30px 0;
}

/* Video Card */
.video-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.video-card .thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #1a1a2e;
    overflow: hidden;
}

.video-card .thumbnail-wrapper img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

.video-card .thumbnail-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #555;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.video-card .play-btn-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50px; height: 50px;
    background: rgba(0, 123, 255, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.video-card:hover .play-btn-overlay {
    opacity: 1;
}

.video-card .card-info {
    padding: 14px;
}

.video-card .card-title {
    font-size: 0.95rem;
    font-weight: bold;
    color: #222;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: #888;
}

.video-card .card-platforms span {
    display: inline-block;
    background: #e9ecef;
    border-radius: 3px;
    padding: 2px 6px;
    margin-right: 3px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.video-card .card-status {
    font-size: 0.78rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    background: #d4edda;
    color: #155724;
}

.video-card .card-status.pending {
    background: #fff3cd;
    color: #856404;
}

.video-card .card-status.processing {
    background: #cce5ff;
    color: #004085;
}

/* Video Modal */
.video-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-modal {
    background: #111;
    border-radius: 12px;
    width: 100%;
    max-width: 860px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0,0,0,0.7);
}

.video-modal-close {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.video-modal-close:hover {
    opacity: 1;
}

.video-modal video {
    width: 100%;
    display: block;
    border-radius: 0 0 12px 12px;
    background: #000;
    max-height: 70vh;
}

.video-modal-title {
    color: #eee;
    padding: 16px 20px 10px;
    font-size: 1rem;
    font-weight: bold;
    padding-right: 40px;
}
