:root {
    --accent: #6366f1;
    --bg-dark: rgba(0, 0, 0, 0.8);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: white;
    font-family: sans-serif;
    /* ФОН */
    background: #121212 url('bg.png') no-repeat center center fixed !important;
    background-size: cover !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.controls {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.1);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

input {
    flex: 2;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #222;
    color: white;
}

button, .file-label {
    padding: 10px 15px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

/* СЕТКА */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    justify-content: center;
}

.card {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
    min-height: 150px; /* Чтобы карточка не была пустой */
    display: flex;
    align-items: center;
    justify-content: center;
}

.card img, .card video {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.7);
}

.card:hover img, .card:hover video {
    filter: brightness(1);
}

/* Кнопка удаления */
.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    z-index: 10;
    display: none;
    cursor: pointer;
}

.card:hover .delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* МОДАЛКА */
.modal-overlay {
    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;
}

.modal-content {
    position: relative;
    max-width: 90%;
}

.modal-content img, .modal-content video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    background: none;
    border: none;
    cursor: pointer;
}