:root {
    --primary-bg: #0b0f19;
    --card-bg: rgba(22, 27, 40, 0.7);
    --gold: #D4AF37;
    --gold-light: #F7E395;
    --gold-dark: #AA8C2C;
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    --border: rgba(255, 255, 255, 0.08);
    --glass-shimmer: rgba(255, 255, 255, 0.03);
    --success: #10B981;
    --danger: #EF4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--primary-bg);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(212, 175, 55, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(76, 29, 149, 0.15), transparent 25%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* --- Premium Decorations --- */
.bg-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120vw;
    height: 120vh;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -2;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: rgba(212, 175, 55, 0.15);
    top: 10%;
    left: 10%;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(45, 55, 72, 0.4);
    bottom: 10%;
    right: 10%;
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, -30px);
    }
}

/* --- Container & Cards --- */
.container {
    width: 100%;
    max-width: 550px;
    perspective: 1000px;
    z-index: 10;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Shimmer Effect on Card */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(115deg,
            transparent 30%,
            rgba(255, 255, 255, 0.03) 45%,
            rgba(255, 255, 255, 0.03) 55%,
            transparent 70%);
    animation: shimmer 8s infinite linear;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-150%);
    }

    50%,
    100% {
        transform: translateX(150%);
    }
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Logo Design --- */
.logo-wrapper {
    width: fit-content;
    height: 140px;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 2;
    /* Reduced border radius to prevent clipping text in corners */
    border-radius: 12px;
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /* Remove solid background to avoid 'blackness' complaints if any gap remains */

    /* Strong outward glow strictly outside the border */
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        /* Tiny dark rim for definition */
        0 0 30px rgba(212, 175, 55, 0.3),
        /* General gold glow */
        0 0 60px rgba(212, 175, 55, 0.1);
    /* Distant glow */

    transition: transform 0.3s ease;
}

/* 4 Corners Lamp Motif - Pushed OUTWARDS */
.logo-wrapper::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    /* Start slightly outside */
    border-radius: 16px;
    /* Slightly larger radius than parent */
    z-index: -1;
    background: transparent;
    box-shadow:
        /* Top Left Lamp */
        -10px -10px 20px rgba(212, 175, 55, 0.8),
        /* Top Right Lamp */
        10px -10px 20px rgba(212, 175, 55, 0.8),
        /* Bottom Left Lamp */
        -10px 10px 20px rgba(212, 175, 55, 0.8),
        /* Bottom Right Lamp */
        10px 10px 20px rgba(212, 175, 55, 0.8);
    opacity: 0.6;
    animation: pulse-lights 3s infinite ease-in-out;
}

/* Clean up previous pseudo if any */
.logo-wrapper::before {
    display: none;
}

@keyframes pulse-lights {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.01);
    }
}

.logo-wrapper:hover {
    transform: scale(1.02);
}

.mayor-logo {
    width: auto;
    /* Let aspect ratio decide width */
    height: 100%;
    /* Fill height */
    /* Use contain if aspect ratio is risky, but cover requested for no gaps.
       With a square container and square logo, cover is fine. 
       Adding a tiny internal padding ensures text near edges isn't touched by border. */
    object-fit: contain;
    padding: 0;
    /* Remove padding for tight fit */
    border-radius: 10px;
    display: block;
}

/* --- Typography --- */
h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

@media (max-width: 500px) {
    h1 {
        font-size: 1.6rem;
    }
}

.subtitle {
    text-align: center;
    color: var(--gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.divider {
    height: 1px;
    background: radial-gradient(circle, var(--border) 0%, transparent 100%);
    width: 100%;
    margin-bottom: 2.5rem;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
    transition: color 0.3s;
}

input[type="text"],
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

textarea {
    resize: none;
    min-height: 140px;
}

/* Custom Placeholder */
::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* --- Stars Rating --- */
.rating-group {
    display: flex;
    justify-content: center;
    flex-direction: row-reverse;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 24px;
    border-radius: 50px;
    border: 1px solid var(--border);
    width: max-content;
    margin: 0 auto;
}

.rating-group input {
    display: none;
}

.rating-group label {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: 0;
    line-height: 1;
    transform-origin: center;
}

.rating-group label::before {
    content: '★';
}

.rating-group input:checked~label,
.rating-group label:hover,
.rating-group label:hover~label {
    color: var(--gold);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    transform: scale(1.1);
}

/* --- Button --- */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    padding: 18px;
    border-radius: 12px;
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 10px 20px -5px rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(212, 175, 55, 0.4);
    filter: brightness(1.1);
}

.submit-btn:active {
    transform: translateY(1px);
}

.submit-btn span {
    position: relative;
    z-index: 1;
}

/* --- Success Message --- */
.success-overlay {
    position: absolute;
    inset: 0;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 20;
}

.success-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    margin-bottom: 20px;
    width: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-overlay.active .success-icon {
    width: 80px;
    height: 80px;
}

.success-overlay h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 10px;
    transform: translateY(20px);
    transition: transform 0.5s ease 0.2s;
}

.success-overlay.active h3 {
    transform: translateY(0);
}

/* --- Admin Panel Specifics --- */
.admin-container {
    max-width: 1100px;
    width: 95%;
    margin: 40px auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.admin-brand h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: white;
}

.admin-brand p {
    color: var(--gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.admin-toolbar {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--gold);
}

.upload-btn {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gold);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.stat-box::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--gold);
    filter: blur(60px);
    opacity: 0.15;
    top: -10px;
    right: -10px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-container {
    width: 100%;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chart-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.chart-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.message-grid {
    display: grid;
    gap: 16px;
}

.msg-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, background 0.2s;
}

.msg-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.msg-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.msg-author {
    color: white;
    font-weight: 600;
}

.msg-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.msg-text {
    color: #e2e8f0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.stars-static {
    color: var(--gold);
    letter-spacing: 2px;
}