/* 
  Minecraft Election - Premium UI/UX 
  Aesthetic: Glassmorphism, Modern Typography, Minecraft Inspired Animations
*/

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

:root {
    --font-main: 'Outfit', sans-serif;
    
    /* Premium Color Palette */
    --clr-primary: #6366f1;
    --clr-primary-hover: #4f46e5;
    --clr-secondary: #0ea5e9;
    --clr-accent: #10b981;
    --clr-danger: #ef4444;
    --clr-warning: #f59e0b;
    
    /* Minecraft Colors */
    --mc-grass: #7fb238;
    --mc-dirt: #866043;
    --mc-stone: #7a7a7a;
    --mc-diamond: #4cedd9;
    --mc-gold: #fdf55f;

    /* Light Theme Tokens */
    --bg-body-light: #f8fafc;
    --bg-card-light: rgba(255, 255, 255, 0.85);
    --text-main-light: #1e293b;
    --text-muted-light: #64748b;
    --border-light: rgba(226, 232, 240, 0.8);
    --shadow-light: 0 10px 30px -5px rgba(0, 0, 0, 0.05);

    /* Dark Theme Tokens */
    --bg-body-dark: #0f172a;
    --bg-card-dark: rgba(30, 41, 59, 0.7);
    --text-main-dark: #f8fafc;
    --text-muted-dark: #94a3b8;
    --border-dark: rgba(51, 65, 85, 0.5);
    --shadow-dark: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body-light);
    color: var(--text-main-light);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-theme="dark"] {
    background-color: var(--bg-body-dark);
    color: var(--text-main-dark);
}

/* === MINECRAFT ANIMATED BACKGROUND === */
.background-wrapper {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent),
                radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.05), transparent);
}

.mc-blocks {
    position: absolute;
    width: 100%;
    height: 100%;
}

.mc-block {
    position: absolute;
    width: 60px;
    height: 60px;
    background-size: cover;
    opacity: 0.15;
    image-rendering: pixelated;
    pointer-events: none;
    animation: float-block 20s infinite linear;
    border-radius: 4px;
}

/* Mocking Minecraft block looks with gradients if textures aren't available */
.mc-block.grass { background: linear-gradient(to bottom, #7fb238 30%, #866043 30%); }
.mc-block.diamond { background: radial-gradient(circle, #4cedd9, #299e90); box-shadow: 0 0 15px rgba(76, 237, 217, 0.3); }
.mc-block.gold { background: radial-gradient(circle, #fdf55f, #cfa800); }
.mc-block.stone { background: #7a7a7a; border: 2px solid #555; }

@keyframes float-block {
    0% { transform: translateY(110vh) rotate(0deg); }
    100% { transform: translateY(-20vh) rotate(360deg); }
}

/* === GLASSMORPHISM CONTAINERS === */
.glass-panel {
    background: var(--bg-card-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

body[data-theme="dark"] .glass-panel {
    background: var(--bg-card-dark);
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-dark);
}

/* === INITIAL LOGIN === */
.initial-login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    max-width: 480px;
    width: 100%;
    padding: 3rem;
    text-align: center;
}

.login-card h2 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p {
    color: var(--text-muted-light);
    margin-bottom: 2rem;
}

body[data-theme="dark"] .login-card p {
    color: var(--text-muted-dark);
}

/* === MAIN APP LAYOUT === */
.app-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 85vh;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

body[data-theme="dark"] .header-section {
    border-bottom: 1px solid var(--border-dark);
}

.app-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--clr-primary);
}

.app-main-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .app-main-grid {
        grid-template-columns: 1fr;
    }
}

/* === NAVIGATION === */
.nav-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 6px;
    border-radius: 16px;
    width: max-content;
}

body[data-theme="dark"] .nav-tabs {
    background: rgba(255, 255, 255, 0.03);
}

.nav-tab {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted-light);
}

body[data-theme="dark"] .nav-tab {
    color: var(--text-muted-dark);
}

.nav-tab:hover {
    color: var(--clr-primary);
}

.nav-tab.active {
    background: white;
    color: var(--clr-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body[data-theme="dark"] .nav-tab.active {
    background: #334155;
    color: white;
}

/* === FORMS & INPUTS === */
.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main-light);
}

body[data-theme="dark"] .input-label {
    color: var(--text-main-dark);
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

body[data-theme="dark"] .input-field {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border-dark);
    color: white;
}

.input-field:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-main-light);
}

body[data-theme="dark"] .btn-ghost {
    border: 1px solid var(--border-dark);
    color: white;
}

.btn-danger {
    background: #fee2e2;
    color: #ef4444;
}

body[data-theme="dark"] .btn-danger {
    background: #450a0a;
    color: #f87171;
}

/* === PARTY CARDS === */
.party-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.party-card {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.party-card:hover {
    transform: translateY(-8px);
}

.party-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.party-name {
    font-size: 1.25rem;
    font-weight: 800;
}

/* === LIVE VOTE SIDEBAR === */
.sidebar-panel {
    padding: 1.5rem;
    height: fit-content;
}

.vote-tally-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vote-tally-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
}

body[data-theme="dark"] .vote-tally-item {
    background: rgba(255, 255, 255, 0.05);
}

.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--clr-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
}

.progress-bar-container {
    height: 6px;
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--clr-primary), var(--clr-secondary));
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === 3D VOTE ANIMATION === */
.vote-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Base styles for 3d box omitted for brevity, keeping existing logic but styling it better */

/* === UTILS === */
.hidden { display: none !important; }

/* === MOBILE === */
@media (max-width: 640px) {
    .app-container {
        padding: 1.5rem;
        margin: 0;
    }
    .nav-tabs {
        width: 100%;
        overflow-x: auto;
    }
    .party-grid {
        grid-template-columns: 1fr;
    }
}