@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary: #0f172a;
    --secondary: #ff5f6d;
    --accent: #ffc371;
    --bg: #050915;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.08);
    --text: #e2e8f0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at top, #132347 0%, #050915 50%, #01030b 100%);
    color: var(--text);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.08) 0, transparent 45%), radial-gradient(circle at 70% 0%, rgba(255, 95, 109, 0.12) 0, transparent 35%);
    z-index: -2;
}

img {
    max-width: 100%;
    display: block;
}

.hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(17, 24, 39, 0.8));
    color: #f8fafc;
    padding: 4rem 1rem 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 95, 109, 0.35), transparent 55%), radial-gradient(circle at 80% 0%, rgba(255, 195, 113, 0.3), transparent 45%);
    z-index: 0;
    pointer-events: none;
}

.hero__content {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    animation: float 6s ease-in-out infinite;
}

.hero__cta {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    background: linear-gradient(120deg, var(--secondary), var(--accent));
    border: 0;
    color: #0b0f1f;
    padding: 0.9rem 1.7rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(255, 95, 109, 0.35);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 35px rgba(255, 95, 109, 0.5);
}

.btn--ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #f8fafc;
    box-shadow: none;
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
    background: rgba(5, 9, 21, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav a {
    text-decoration: none;
    color: #e2e8f0;
    font-weight: 600;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.nav a.active,
.nav a:hover {
    color: #fff;
    border-color: var(--secondary);
}

.container {
    max-width: 1100px;
    margin: 1rem auto 2.5rem;
    padding: 2.5rem 1rem 0;
    position: relative;
}

main {
    scroll-margin-top: 110px;
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(5, 9, 21, 0.6);
    backdrop-filter: blur(18px);
}

.alert--success {
    color: #90e0a4;
    border-color: rgba(144, 224, 164, 0.3);
}

.alert--error {
    color: #ffb3c1;
    border-color: rgba(255, 179, 193, 0.35);
}

.alert--warning {
    color: #ffe39c;
    border-color: rgba(255, 227, 156, 0.35);
}

.panel {
    background: var(--glass);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 70px rgba(5, 9, 21, 0.45);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

.form {
    display: grid;
    gap: 1rem;
}

.form input,
.form textarea,
.form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.6);
    color: #f8fafc;
}

.form--inline {
    display: flex;
    justify-content: flex-end;
}

.admin-form {
    margin-top: 1rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery__card {
    background: var(--glass);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(5, 9, 21, 0.45);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery__card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 55px rgba(5, 9, 21, 0.6);
}

.gallery__card img {
    height: 230px;
    object-fit: cover;
}

.gallery__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta {
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.9rem;
    margin: 0;
}

.vote-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.inline-form {
    margin: 0;
}

.inline-form button {
    width: 100%;
}

.vote-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #58f29c;
    font-weight: 600;
    background: rgba(88, 242, 156, 0.12);
    border: 1px solid rgba(88, 242, 156, 0.3);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
}

.vote-indicator::before {
    content: '★';
}

.ranking {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking__item {
    display: grid;
    grid-template-columns: auto 120px 1fr auto;
    gap: 1rem;
    background: var(--glass);
    border-radius: 16px;
    padding: 1rem;
    align-items: center;
    border: 1px solid var(--border);
    box-shadow: 0 20px 45px rgba(5, 9, 21, 0.45);
}

.ranking__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ranking__item img {
    height: 80px;
    width: 120px;
    object-fit: cover;
    border-radius: 12px;
}

.ranking__position {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.9rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: rgba(226, 232, 240, 0.8);
    background: var(--glass);
    border-radius: 14px;
    box-shadow: 0 25px 45px rgba(5, 9, 21, 0.4);
    border: 1px solid var(--border);
}

.form input::placeholder,
.form textarea::placeholder {
    color: rgba(248, 250, 252, 0.6);
}

.gallery__card h3,
.ranking__item h3,
.panel h2,
.panel h3,
h2,
h3 {
    color: #f8fafc;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 9, 21, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.loading-overlay__content {
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--secondary);
    animation: spin 0.9s linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0px);
    }
}

@media (max-width: 720px) {
    .ranking__item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .ranking__item img {
        margin: 0 auto;
    }

    .vote-form {
        flex-direction: column;
    }
}
