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

:root {
    --app-primary: #0f766e;
    --app-primary-deep: #115e59;
    --app-secondary: #155eef;
    --app-accent: #f59e0b;
    --app-text: #0f172a;
    --app-text-soft: #475569;
    --app-border: #dbe4f0;
    --app-surface: #ffffff;
    --app-surface-soft: #f5f8fc;
    --app-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: var(--app-text);
    background:
        radial-gradient(1300px circle at -12% -18%, rgba(21, 94, 239, 0.2), transparent 42%),
        radial-gradient(850px circle at 112% -10%, rgba(15, 118, 110, 0.2), transparent 36%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    min-height: 100vh;
}

.water-splash-layer {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.water-splash-layer .splash,
.water-splash-layer .droplet {
    position: absolute;
    display: block;
    opacity: 0.42;
}

.water-splash-layer .splash {
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,0.82), rgba(255,255,255,0) 28%),
        radial-gradient(circle at 50% 50%, rgba(124, 211, 255, 0.24), rgba(21, 94, 239, 0.1) 58%, rgba(21, 94, 239, 0) 72%);
    border-radius: 58% 42% 63% 37% / 42% 57% 43% 58%;
    box-shadow: inset 0 0 24px rgba(255,255,255,0.16), 0 20px 40px rgba(21, 94, 239, 0.08);
    animation: splashFloat 15s ease-in-out infinite;
}

.water-splash-layer .droplet {
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.92), rgba(126, 216, 255, 0.5) 42%, rgba(21, 94, 239, 0.06) 75%);
    border-radius: 50% 50% 58% 42% / 44% 44% 56% 56%;
    box-shadow: 0 8px 18px rgba(21, 94, 239, 0.08);
    animation: dropletDrift 12s ease-in-out infinite;
}

.splash-a {
    width: 240px;
    height: 180px;
    left: -48px;
    top: 88px;
    transform: rotate(-18deg);
}

.splash-b {
    width: 180px;
    height: 140px;
    right: 8%;
    top: 128px;
    transform: rotate(24deg);
    animation-delay: -5s;
}

.splash-c {
    width: 220px;
    height: 160px;
    right: -44px;
    bottom: 18%;
    transform: rotate(-28deg);
    animation-delay: -8s;
}

.droplet-a {
    width: 28px;
    height: 28px;
    left: 14%;
    top: 22%;
    animation-delay: -2s;
}

.droplet-b {
    width: 18px;
    height: 18px;
    right: 16%;
    top: 18%;
    animation-delay: -4s;
}

.droplet-c {
    width: 24px;
    height: 24px;
    right: 10%;
    bottom: 24%;
    animation-delay: -7s;
}

.droplet-d {
    width: 14px;
    height: 14px;
    left: 8%;
    bottom: 18%;
    animation-delay: -9s;
}

@keyframes splashFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    }
    50% {
        transform: translate3d(0, -10px, 0) rotate(6deg) scale(1.03);
    }
}

@keyframes dropletDrift {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, -8px, 0) scale(1.08);
    }
}

main.container {
    padding-top: 1.1rem;
    padding-bottom: 2.2rem;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(219, 228, 240, 0.9);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,248,255,0.95));
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    font-size: 0.86rem;
    letter-spacing: 0.08em;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(21, 94, 239, 0.18);
}

.login-logo {
    width: 104px;
    height: 104px;
    object-fit: cover;
    border-radius: 28px;
    box-shadow: 0 16px 36px rgba(21, 94, 239, 0.2);
}

.hero-app-logo {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: 0 16px 34px rgba(21, 94, 239, 0.2);
}

.navbar {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.86) !important;
    z-index: 10;
}

.navbar-brand {
    letter-spacing: 0.02em;
}

.navbar .nav-link {
    color: #334155;
    border-radius: 999px;
    padding: 0.42rem 0.78rem;
    transition: all 0.2s ease;
}

.nav-profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.92);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--app-primary), var(--app-secondary));
}

.card {
    border: 1px solid rgba(219, 228, 240, 0.85);
    border-radius: 1rem;
    box-shadow: var(--app-shadow);
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    z-index: 1;
}

.card .card-title,
h1, h2, h3, h4, h5, h6 {
    color: var(--app-text);
}

.btn {
    border-radius: 0.8rem;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--app-primary), var(--app-secondary));
    border: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--app-primary-deep), #1d4ed8);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
}

.form-control,
.form-select,
.input-group-text,
textarea {
    border-radius: 0.8rem !important;
    border-color: var(--app-border);
    background-color: #fff;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: rgba(21, 94, 239, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(21, 94, 239, 0.12);
}

.table {
    --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
    border-bottom-color: #edf2f8;
}

.table thead th {
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.list-group-item {
    border-color: #edf2f8;
}

.alert {
    border: none;
    border-radius: 0.9rem;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(241, 245, 249, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner-border {
    width: 2.4rem;
    height: 2.4rem;
}

.pre-vote-blur {
    filter: blur(10px);
    transform: scale(1.02);
}

.hero-strip {
    position: relative;
    overflow: hidden;
    background: linear-gradient(130deg, #0f766e 0%, #155eef 100%);
    color: #fff;
}

.hero-strip .text-muted {
    color: rgba(255, 255, 255, 0.78) !important;
}

.hero-strip::before {
    content: '';
    position: absolute;
    width: 230px;
    height: 230px;
    border-radius: 999px;
    right: -60px;
    top: -70px;
    background: rgba(255, 255, 255, 0.14);
}

.stat-card .display-6 {
    font-weight: 800;
}

.section-head {
    margin-bottom: 1rem;
}

.section-head .hint {
    color: var(--app-text-soft);
    font-size: 0.88rem;
}

.vote-item-card img {
    height: 190px;
    object-fit: cover;
}

.vote-meta {
    color: var(--app-text-soft);
    font-size: 0.82rem;
}

.soft-box {
    background: var(--app-surface-soft);
    border: 1px solid #e7edf5;
    border-radius: 0.85rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-tile {
    min-height: 100%;
}

.ranking-table tbody tr {
    transition: background-color 0.2s ease;
}

.app-fade-up {
    animation: appFadeUp 0.45s ease both;
}

.app-delay-1 {
    animation-delay: 0.06s;
}

.app-delay-2 {
    animation-delay: 0.12s;
}

@keyframes appFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coupon-code {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.admin-pills {
    display: flex;
    flex-wrap: wrap;
}

.admin-pills .btn {
    min-width: 150px;
}

.admin-table thead th {
    position: sticky;
    top: 0;
    background: rgba(248, 251, 255, 0.96);
    z-index: 1;
}

.admin-table tbody tr:nth-child(odd) {
    background: rgba(248, 251, 255, 0.72);
}

.admin-table tbody tr:hover {
    background: rgba(230, 239, 250, 0.78);
}

.admin-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.8rem;
    border: 1px solid var(--app-border);
    background: #fff;
}

.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 2rem 1.5rem;
    border: 2px dashed rgba(21, 94, 239, 0.3);
    border-radius: 1.25rem;
    background:
        radial-gradient(circle at top, rgba(21, 94, 239, 0.08), transparent 42%),
        linear-gradient(180deg, #fbfdff 0%, #f2f8ff 100%);
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    text-align: center;
}

.upload-dropzone.has-file {
    border-color: rgba(15, 118, 110, 0.45);
    background:
        radial-gradient(circle at top, rgba(15, 118, 110, 0.12), transparent 42%),
        linear-gradient(180deg, #fbfefd 0%, #eefaf7 100%);
}

.upload-dropzone.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.upload-dropzone-icon {
    width: 72px;
    height: 72px;
    border-radius: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--app-primary), var(--app-secondary));
    box-shadow: 0 14px 26px rgba(21, 94, 239, 0.2);
}

.upload-dropzone-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.upload-dropzone-subtitle {
    color: var(--app-text-soft);
    font-size: 0.92rem;
}

.upload-file-meta {
    margin-top: 1rem;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.upload-file-meta span {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--app-border);
    font-size: 0.84rem;
}

.upload-preview-card {
    overflow: hidden;
    border-radius: 1.1rem;
    border: 1px solid var(--app-border);
    background: #fff;
    box-shadow: var(--app-shadow);
    animation: uploadRise 0.28s ease;
}

.upload-preview-card img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.upload-shell {
    overflow: hidden;
}

.upload-shell .card-body,
.upload-config-card {
    animation: uploadFade 0.35s ease;
}

@keyframes uploadFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes uploadRise {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

canvas {
    min-height: 260px;
}

@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: translateY(-1px);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.09);
    }

    .soft-box:hover {
        transform: translateY(-1px);
        border-color: rgba(21, 94, 239, 0.22);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    }

    .ranking-table tbody tr:hover {
        background: rgba(238, 245, 255, 0.95);
    }

    .upload-dropzone:hover {
        transform: translateY(-2px);
        border-color: rgba(15, 118, 110, 0.45);
        box-shadow: 0 16px 34px rgba(21, 94, 239, 0.08);
    }
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 0.85rem;
        padding: 0.8rem;
        border-radius: 1rem;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(219, 228, 240, 0.95);
        box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
    }

    .navbar .nav-link {
        margin-bottom: 0.35rem;
        padding: 0.7rem 0.95rem;
    }

    .nav-profile-item {
        margin-top: 0.45rem;
    }

    .vote-item-card img {
        height: 160px;
    }

    .admin-pills .btn {
        width: 100%;
    }

    .admin-thumb {
        width: 40px;
        height: 40px;
    }

    .upload-dropzone {
        min-height: 250px;
        padding: 1.5rem 1rem;
    }

    .upload-preview-card img {
        max-height: 300px;
    }

    .profile-hero {
        align-items: flex-start !important;
    }
}

@media (max-width: 575.98px) {
    main.container {
        padding-top: 0.8rem;
        padding-bottom: 1.4rem;
    }

    .brand-pill {
        padding: 0.62rem 0.85rem;
        font-size: 0.78rem;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .login-logo {
        width: 88px;
        height: 88px;
        border-radius: 24px;
    }

    .hero-app-logo {
        width: 60px;
        height: 60px;
        border-radius: 18px;
    }

    .splash-a {
        width: 160px;
        height: 120px;
        top: 110px;
    }

    .splash-b {
        width: 130px;
        height: 100px;
        top: 96px;
    }

    .splash-c {
        width: 150px;
        height: 110px;
    }

    .section-head {
        gap: 0.4rem;
        flex-direction: column;
        align-items: flex-start !important;
    }

    .nav-profile-chip {
        width: 100%;
        justify-content: flex-start;
    }

    .upload-dropzone {
        min-height: 220px;
        padding: 1.25rem 0.9rem;
        border-radius: 1rem;
    }

    .upload-dropzone-icon {
        width: 60px;
        height: 60px;
        font-size: 1.7rem;
        margin-bottom: 0.85rem;
    }

    .upload-dropzone-title {
        font-size: 1rem;
    }

    .upload-dropzone-subtitle {
        font-size: 0.85rem;
    }

    .upload-file-meta {
        width: 100%;
    }

    .upload-file-meta span {
        width: 100%;
        text-align: center;
    }

    .upload-preview-card img {
        max-height: 240px;
    }

    .btn {
        min-height: 46px;
    }

    .table th,
    .table td {
        white-space: nowrap;
    }
}
