/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

/* Header */
header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content h1 {
    font-size: 1.8rem;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #aaa;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* Admin nav */
.admin-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: #00d4ff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #00d4ff;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #00d4ff;
    color: #1a1a2e;
}

.logout-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #ff6b7a;
}

/* Main content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-btn.active {
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    color: #1a1a2e;
    border-color: transparent;
    font-weight: 600;
}

/* Stats */
.stats {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 0.95rem;
    color: #aaa;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Media card */
.media-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.3);
}

.media-card.archived {
    opacity: 0.6;
    border-color: #ffa502;
}

.media-preview {
    position: relative;
    width: 100%;
    height: 180px;
    background: #000;
    overflow: hidden;
}

.media-preview video,
.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 212, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.media-card:hover .play-overlay {
    background: rgba(0, 212, 255, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.media-info {
    padding: 1rem;
}

.media-name {
    display: block;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}

.media-size {
    font-size: 0.75rem;
    color: #888;
}

/* Admin actions */
.admin-actions {
    padding: 0 1rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.admin-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.archive-btn {
    background: #ffa502;
    color: #1a1a2e;
}

.archive-btn:hover {
    background: #ffb833;
}

.restore-btn {
    background: #2ed573;
    color: #1a1a2e;
}

.restore-btn:hover {
    background: #5fe091;
}

.delete-btn {
    background: #ff4757;
    color: white;
}

.delete-btn:hover {
    background: #ff6b7a;
}

/* Admin tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    color: #1a1a2e;
    border-color: transparent;
    font-weight: 600;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-video-container {
    max-height: 70vh;
}

.modal-content video,
.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
}

.image-modal img {
    max-height: 80vh;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #ff4757;
}

.modal-actions {
    padding: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.action-btn {
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    color: #1a1a2e;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.frame-btn {
    background: linear-gradient(90deg, #ffa502, #ff6b35);
}

.quality-btn {
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
}

/* Quality badge on video */
.video-quality-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.3rem 0.7rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 5;
}

.video-quality-badge.preview {
    background: rgba(255, 165, 2, 0.9);
    color: #1a1a2e;
}

.video-quality-badge.original {
    background: rgba(0, 212, 255, 0.9);
    color: #1a1a2e;
}

/* Preview badge on cards */
.preview-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 165, 2, 0.9);
    color: #1a1a2e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 5;
}

/* Quality selector */
.quality-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 25px;
}

.quality-selector label {
    font-size: 0.85rem;
    color: #aaa;
}

.quality-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

.quality-selector select:focus {
    outline: none;
    border-color: #00d4ff;
}

/* Modal info */
.modal-info {
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
}

.video-info {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.info-item {
    font-size: 0.8rem;
    color: #aaa;
}

/* Media tag */
.media-tag {
    display: inline-block;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    color: #1a1a2e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

/* Tag section */
.tag-section {
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.tag-input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.tag-input:focus {
    outline: none;
    border-color: #00d4ff;
}

.tag-input.saved {
    border-color: #2ed573;
    background: rgba(46, 213, 115, 0.1);
}

.tag-save-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: #00d4ff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.tag-save-btn:hover {
    background: #00d4ff;
    color: #1a1a2e;
}

/* Published/Unpublished badges */
.published-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(46, 213, 115, 0.9);
    color: #1a1a2e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 5;
}

.unpublished-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 71, 87, 0.9);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 5;
}

/* Publish/Unpublish buttons */
.publish-btn {
    background: #2ed573 !important;
    color: #1a1a2e !important;
}

.publish-btn:hover {
    background: #5fe091 !important;
}

.unpublish-btn {
    background: #ff6b35 !important;
    color: white !important;
}

.unpublish-btn:hover {
    background: #ff8c5a !important;
}

/* Mute/Unmute buttons */
.mute-btn {
    background: #9b59b6 !important;
    color: white !important;
}

.mute-btn:hover {
    background: #a86cc4 !important;
}

.unmute-btn {
    background: #3498db !important;
    color: white !important;
}

.unmute-btn:hover {
    background: #5dade2 !important;
}

/* Tab with archive access */
.tab-btn.has-access {
    border-color: #2ed573;
    color: #2ed573;
}

/* Archive password modal */
.archive-password-modal {
    max-width: 400px;
    padding: 2rem;
    text-align: center;
}

.archive-password-modal h2 {
    margin-bottom: 0.5rem;
    color: #fff;
}

.archive-password-modal p {
    color: #aaa;
    margin-bottom: 1.5rem;
}

.modal-close-btn {
    margin-top: 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #aaa;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Muted badge */
.muted-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(155, 89, 182, 0.9);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 5;
}

/* Published/Unpublished card styles */
.media-card.unpublished {
    border-color: rgba(255, 71, 87, 0.3);
    opacity: 0.8;
}

.media-card.published {
    border-color: rgba(46, 213, 115, 0.3);
}

/* Responsive updates */
@media (max-width: 768px) {
    .tag-section {
        flex-direction: column;
    }

    .tag-save-btn {
        width: 100%;
    }
}

/* Bulk actions */
.bulk-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.bulk-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.publish-all-btn {
    background: linear-gradient(90deg, #2ed573, #00ff88);
    color: #1a1a2e;
}

.publish-all-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(46, 213, 115, 0.3);
}

.unpublish-all-btn {
    background: linear-gradient(90deg, #ff6b35, #ff4757);
    color: white;
}

.unpublish-all-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
}

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

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

.login-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.login-box h1 {
    font-size: 1.5rem;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-box h2 {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #aaa;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #aaa;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.error-msg {
    color: #ff4757;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: #00d4ff;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-content h1 {
        font-size: 1.4rem;
    }

    main {
        padding: 1rem;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 10px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .admin-actions {
        flex-direction: column;
    }
}
