/* backend/gallery/assets/style.css */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --primary-color: #bb86fc;
    --danger-color: #cf6679;
    --success-color: #03dac6;
    --border-radius: 12px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

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

.login-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    background-color: #2c2c2c;
    border: 1px solid #333;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s;
}

.btn.primary {
    background-color: var(--primary-color);
    color: #000;
    width: 100%;
}

.btn.primary:hover {
    opacity: 0.9;
}

.btn.danger {
    background-color: var(--danger-color);
    color: #fff;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.btn.secondary {
    background-color: #333;
    color: #fff;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
}

.alert.error {
    background-color: rgba(207, 102, 121, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
}

.logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

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

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.2s;
    position: relative;
}

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

.card-img {
    width: 100%;
    height: 180px;
    background-color: #000;
    position: relative;
    cursor: pointer;
}

.card-img video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.7;
    pointer-events: none;
    /* Let clicks pass through to container */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.card-img:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    transition: all 0.2s;
}

.card-body {
    padding: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

/* Lightbox */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    /* Increased size */
    font-weight: bold;
    cursor: pointer;
    z-index: 1002;
    /* Above everything */
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent bg */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox video {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
}

.lightbox-download {
    position: absolute;
    bottom: 30px;
    background-color: var(--primary-color);
    color: #000;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    z-index: 1001;
    transition: transform 0.2s;
}

.lightbox-download:hover {
    transform: scale(1.05);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    text-align: center;
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

    100% {
        transform: rotate(360deg);
    }
}