/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fb;
    color: #1e293b;
    line-height: 1.5;
}

header, footer {
    text-align: center;
    padding: 1.5rem;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.gallery {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
}

.video-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

.video-card iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
}

.video-meta {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: #475569;
    text-align: right;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 1rem;
    color: #64748b;
}

/* Стили для админки */
.login-container, .admin-container {
    max-width: 1200px;
    margin: 3rem auto;
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

.login-container {
    max-width: 400px;
}

.login-container h2, .admin-container h1 {
    margin-bottom: 1.5rem;
    text-align: center;
}

label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    font-size: 1rem;
}

button {
    margin-top: 1.5rem;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #2563eb;
}

.delete-btn {
    background: #ef4444;
}

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

.success-message {
    background: #dcfce7;
    color: #15803d;
    padding: 0.75rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.error-message {
    background: #fee2e2;
    color: #b91c1c;
    padding: 0.75rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.add-form {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.video-list table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 1rem;
    overflow: auto;
    display: block;
}

.video-list th, .video-list td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
}

.video-list th {
    background: #f8fafc;
}

.preview iframe {
    width: 160px;
    aspect-ratio: 16/9;
    border-radius: 0.5rem;
}

.url {
    max-width: 300px;
    word-break: break-all;
}

.hint {
    font-size: 0.8rem;
    color: #475569;
    margin-top: 0.5rem;
}

.admin-nav {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-nav a {
    text-decoration: none;
    background: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    color: #1e293b;
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
    }
    .video-list table, .video-list thead, .video-list tbody, .video-list tr, .video-list td {
        display: block;
    }
    .video-list tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 1rem;
    }
    .preview iframe {
        width: 100%;
    }
}