/* Основни настройки */
body {
    background: #121212;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

/* Централна кутия за качване */
.upload-box {
    max-width: 700px;
    margin: 40px auto;
    padding: 20px 30px;
    background: #1f1f1f;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Заглавие */
.upload-box h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
}

/* Успешно съобщение */
.success {
    color: #00ff88;
    margin-bottom: 15px;
}

/* Решетка за изображения */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto 20px auto; /* Центрира и дава margin-bottom */
}

/* Отделна „кутийка“ за всяко изображение */
.image-box {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1 / 1;
    background: #2a2a2a;
    border: 2px dashed #444;
    border-radius: 8px;
    position: relative;
    text-align: center;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.image-box:hover {
    background: #3a3a3a;
    transform: scale(1.03);
}

/* Текстът „+“ или „thumb +“ */
.image-box span {
    z-index: 1;
    line-height: 1.2em;
}

/* Визуализация на избраното изображение */
.preview-img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    top: 0;
    left: 0;
    z-index: 0;
}

/* Скриване на стандартните input[type=file] */
form input[type="file"] {
    display: none;
}

/* Стилове за текстовите полета */
.upload-box input[type="text"] {
    display: block;
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #303030;
    color: #f1f1f1;
    font-size: 1em;
}

.upload-box input[type="text"]::placeholder {
    color: #bbbbbb;
}

/* Бутон „Качи“ */
.upload-box button[type="submit"] {
    display: block;
    width: 100%;
    padding: 14px;
    background: #00c6ff;
    color: #000;
    font-weight: bold;
    font-size: 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 0 10px #00c6ff;
    transition: background 0.2s ease;
}

.upload-box button[type="submit"]:hover {
    background: #0072ff;
    color: #fff;
}

/* Линк Изход */
.logout-link {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 0.9em;
    display: inline-block;
    margin-top: 15px;
}

.logout-link:hover {
    text-decoration: underline;
}

/* Login форма */
.login-container {
    max-width: 400px;
    margin: 15vh auto;
    padding: 30px;
    background: #1f1f1f;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

.login-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    display: block;
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #303030;
    color: #f1f1f1;
    font-size: 1em;
}

.login-container input[type="text"]::placeholder,
.login-container input[type="password"]::placeholder {
    color: #bbbbbb;
}

.login-container button {
    background: #00c6ff;
    color: #000;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0 10px #00c6ff;
    width: 100%;
    font-size: 1em;
    transition: background 0.2s ease;
}

.login-container button:hover {
    background: #0072ff;
    color: #fff;
}

.login-container .error {
    color: #ff6b6b;
    margin-bottom: 15px;
}

/* Responsive за решетката */
@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        max-width: 100%;
    }
    .image-box {
        max-width: 100px;
    }
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
    .image-box {
        max-width: 80px;
    }
}

.back-to-dashboard {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #00cad7;
    color: #000;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.back-to-dashboard:hover {
    background-color: #00e0b4;
}


select[name="decal_type"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #1f1f1f;
    border: 1px solid #333;
    border-radius: 6px;
    color: var(--color-text);
    font-size: 1rem;
    appearance: none; /* премахва нативната стрелка */
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' fill='%23ccc' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

select[name="decal_type"]:focus {
    border-color: var(--color-accent);
    outline: none;
}
