/* static/style.css – версия 0.0.26 */
:root {
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --link: #4da3ff;
    --border: #333;
    --input-bg: #2a2a2a;
    --btn-primary: #007bff;
    --btn-success: #28a745;
    --btn-info: #17a2b8;
    --flash-success-bg: #1e3a1e;
    --flash-danger-bg: #3a1e1e;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

a {
    color: var(--link);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Центрирующий контейнер для страниц */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px 15px;
}

.flash {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.flash.success {
    background: var(--flash-success-bg);
    color: #b8d9b8;
}
.flash.error, .flash.danger {
    background: var(--flash-danger-bg);
    color: #e0b8b8;
}

/* Компактный центрированный логин */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}
.login-box {
    background: #222;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

label {
    display: block;
    margin-top: 12px;
    font-weight: bold;
}

input, select {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
}
button {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: white;
}
.btn-primary { background: var(--btn-primary); }
.btn-success { background: var(--btn-success); }
.btn-info { background: var(--btn-info); }

footer {
    margin-top: 40px;
    padding: 10px 0;
    text-align: center;
    font-size: 0.8em;
    color: #888;
    border-top: 1px solid #333;
}

/* Галерея */
.gallery-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}
.thumbnail-item {
    background: #222;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: border 0.2s;
}
.thumbnail-item.new-since-login {
    border: 2px solid yellow;
}
.thumbnail-item img,
.thumbnail-item video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background: #000;
}
.thumbnail-info {
    padding: 4px 6px;
    font-size: 0.7em;
    color: #ccc;
    text-align: center;
}
.thumbnail-date {
    display: block;
}
.thumbnail-res, .thumbnail-size {
    display: inline-block;
    margin: 0 4px;
}

/* Полноэкранный просмотр */
.viewer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    display: none;
    z-index: 1000;
}
.viewer img,
.viewer video {
    max-width: 100%;
    max-height: 100%;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.tap-top, .tap-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 1001;
}
.tap-top { top: 0; }
.tap-bottom { bottom: 0; }
.close-btn {
    position: absolute;
    top: 10px; right: 20px;
    color: white;
    font-size: 30px;
    z-index: 1002;
    text-decoration: none;
    background: rgba(0,0,0,0.6);
    padding: 5px 10px;
    border-radius: 50%;
}
.delete-btn {
    position: absolute;
    top: 10px;
    right: 70px;
    color: white;
    font-size: 24px;
    z-index: 1002;
    text-decoration: none;
    background: rgba(255,0,0,0.7);
    padding: 5px 10px;
    border-radius: 50%;
    cursor: pointer;
}

/* Адаптация под мобильные */
@media (max-width: 600px) {
    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
    .thumbnail-info {
        font-size: 0.65em;
    }
}