 @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-color: #0c0d10;
    --card-bg: #16171d;
    --header-bg: rgba(12, 13, 16, 0.85);
    --primary: #0616f4;
    --primary-hover: #0616f4;
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --text-muted: #6b6b6b;
    --accent-blue: #0071eb;
    --border-color: rgba(255, 255, 255, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --radius-sm: 6px;
    --radius-md: 12px;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Layout --- */

header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 4%;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.topnav {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo-img {
    height: 32px;
    transition: var(--transition);
}

.logo-img:hover {
    transform: scale(1.05);
}

.topnav a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.topnav a:hover {
    color: var(--text-main);
}

.topnav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.topnav a:hover::after {
    width: 100%;
}

main {
    padding: 40px 4%;
    max-width: 1400px;
    margin: 0 auto;
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
}

/* --- Movie Grid --- */

.movie-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    list-style: none;
}

.movie-list li {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.movie-list li:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.15);
}

.movie-list a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.movie-list .thumbnail {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.movie-list li:hover .thumbnail {
    transform: scale(1.08);
}

.movie-info {
    padding: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 80%);
}

.label {
    display: inline-block;
    font-size: 0.65rem;
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-card-icon {
    width: 64px;
    height: 64px;
    margin: 40px auto 20px;
    display: block;
    object-fit: contain;
    opacity: 0.8;
    transition: var(--transition);
}

.movie-list li:hover .admin-card-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* --- Login Page --- */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, #1b1c22 0%, #0c0d10 100%);
    padding: 20px;
}

.login-page__card {
    background: rgba(22, 23, 29, 0.8);
    backdrop-filter: blur(20px);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.login-page__title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 32px;
    text-align: center;
    color: var(--text-main);
}

.login-page__input-group {
    position: relative;
    margin-bottom: 24px;
}

.login-page__input {
    width: 100%;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 20px 16px 6px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.login-page__input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.login-page__label {
    position: absolute;
    left: 16px;
    top: 18px;
    color: var(--text-muted);
    transition: var(--transition);
    pointer-events: none;
}

.login-page__input:focus + .login-page__label,
.login-page__input:not(:placeholder-shown) + .login-page__label {
    top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.login-page__button {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(86, 9, 229, 0.3);
}

.login-page__button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(86, 9, 229, 0.3);
}

.login-page__button--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: none;
    margin-top: 16px;
}

.login-page__button--secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.login-page__error {
    background: rgba(229, 9, 20, 0.1);
    color: var(--primary);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid rgba(229, 9, 20, 0.2);
}

/* --- Video Player Page --- */

.video-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 4%;
}

video {
    width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    background: #000;
    overflow: hidden;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Modal Styling --- */

#modal-toggle {
    display: none;
}


.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#modal-toggle:checked ~ .modal-overlay {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    position: relative;
    animation: slideUp 0.4s ease-out;
}

.modal-content h3 {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.form-label {
    display: block;
    margin-top: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
}

.modal-content input[type="text"],
.modal-content input[type="file"],
.modal-content textarea,
.modal-input {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.1);
}

.save-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 700;
    margin-top: 30px;
    cursor: pointer;
}

/* --- Admin Table --- */

.admintabel {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 30px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.admintabel th, .admintabel td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admintabel th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.admintabel tr:last-child td {
    border-bottom: none;
}

.admintabel .thumbnail {
    width: 120px;
    border-radius: 4px;
}

/* --- Buttons --- */

.edit-btn, .vw-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: var(--transition);
}

.edit-btn {
    background: rgba(255, 165, 0, 0.1);
    color: #ffa500;
    margin-right: 8px;
}

.edit-btn:hover { background: #ffa500; color: white; }

.vw-btn {
    background: rgba(35, 9, 229, 0.1);
    color: var(--primary);
}

.vw-btn:hover { background: var(--primary); color: white; }

/* --- Mobile Fixes --- */

@media (max-width: 768px) {
    .movie-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .login-page__card {
        padding: 32px 24px;
    }
    
    .topnav {
        gap: 15px;
    }
    
    .topnav a {
        font-size: 0.85rem;
    }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

footer {
    padding: 60px 4%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
}
