/* CSS Variables */
:root {
    --bg-dark: #1a1a1a;
    --card-bg: rgba(30, 30, 30, 0.8);
    --primary-pink: #FF1493;
    --secondary-pink: #FF69B4;
    --text-white: #ffffff;
    --text-gray: #e0e0e0;
    --border-color: rgba(255, 20, 147, 0.2);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/static/images/background.jpg') center/cover;
    opacity: 0.3;
    z-index: -1;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Header & Logo */
.header {
    text-align: center;
    padding: 32px 16px;
}

.logo {
    margin-bottom: 20px;
}

.logo-top {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary-pink);
    letter-spacing: 2px;
    text-transform: lowercase;
}

.logo-main {
    font-size: 56px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-pink), var(--secondary-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    line-height: 1;
    text-shadow: 0 0 40px rgba(255, 20, 147, 0.5);
}

.logo-bottom {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary-pink);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-gray);
    font-weight: 400;
    max-width: 400px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    padding: 0 16px 20px;
}

.categories-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Category Card */
.category-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary-pink), var(--secondary-pink));
    border-radius: 16px;
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 20, 147, 0.3);
}

.category-card.expanded {
    border-color: var(--primary-pink);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.category-content {
    flex: 1;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-pink);
    margin-bottom: 8px;
    line-height: 1.3;
}

.category-description {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 16px;
}

.category-button {
    background: linear-gradient(135deg, var(--primary-pink), var(--secondary-pink));
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
}

.category-button:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
}

.category-button:active {
    transform: scale(0.98);
}

/* Nominees List */
.nominees-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.category-card.expanded .nominees-list {
    max-height: 2000px;
    margin-top: 20px;
}

.nominee-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.nominee-item:hover {
    background: rgba(255, 20, 147, 0.1);
    border-color: rgba(255, 20, 147, 0.3);
}

.nominee-item.selected {
    background: rgba(255, 20, 147, 0.2);
    border-color: var(--primary-pink);
}

.nominee-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-gray);
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.nominee-item.selected .nominee-radio {
    border-color: var(--primary-pink);
    background: var(--primary-pink);
}

.nominee-item.selected .nominee-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.nominee-name {
    font-size: 15px;
    color: var(--text-white);
    font-weight: 500;
}

/* Submit Button */
.submit-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.submit-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-pink), var(--secondary-pink));
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
}

.submit-button:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 20, 147, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 8px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-gray);
    padding: 8px 20px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
}

.nav-item svg {
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary-pink);
}

.nav-item.active svg {
    stroke: var(--primary-pink);
    filter: drop-shadow(0 0 8px rgba(255, 20, 147, 0.6));
}

.nav-item:hover {
    color: var(--secondary-pink);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    color: var(--text-white);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: #00ff88;
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.3);
}

.toast.error {
    border-color: #ff4444;
    box-shadow: 0 8px 24px rgba(255, 68, 68, 0.3);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
}

.loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* Responsive */
@media (max-width: 480px) {
    .logo-main {
        font-size: 48px;
    }

    .category-title {
        font-size: 18px;
    }

    .category-description {
        font-size: 13px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card {
    animation: fadeIn 0.4s ease forwards;
}

.category-card:nth-child(1) {
    animation-delay: 0.1s;
}

.category-card:nth-child(2) {
    animation-delay: 0.2s;
}

.category-card:nth-child(3) {
    animation-delay: 0.3s;
}

.category-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Grid Layout for Nominees */
.nominees-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 10px 0;
}

.nominee-card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nominee-card.selected {
    background: rgba(255, 20, 147, 0.15);
    border-color: var(--primary-pink);
    box-shadow: 0 0 15px rgba(255, 20, 147, 0.2);
}

.nominee-header {
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.nominee-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nominee-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.nominee-image-container {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.nominee-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.nominee-card:hover .nominee-image {
    transform: scale(1.05);
}

.vote-button {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
    padding: 8px 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
}

.vote-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nominee-card.selected .vote-button {
    background: var(--primary-pink);
    color: white;
    border-color: var(--primary-pink);
}

/* View Navigation */
.view-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-container.active {
    display: block;
}

.back-button {
    background: none;
    border: none;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    padding: 0;
    transition: var(--transition);
}

.back-button:hover {
    color: var(--primary-pink);
    transform: translateX(-4px);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .nominees-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Statistics View Styles */
.stats-category-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
    margin: 20px 0 12px;
    padding-left: 4px;
    text-align: center;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 12px;
    color: white;
    position: relative;
    overflow: hidden;
    height: 60px;
}

/* Rank Styling */
.rank-1 {
    background: linear-gradient(90deg, #ff6b6b 0%, #FF1493 100%);
    box-shadow: 0 4px 12px rgba(255, 20, 147, 0.3);
}

.rank-2 {
    background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
    /* Lighter purple/pink */
    background: #96617D;
    /* Fallback based on image */
    box-shadow: 0 4px 12px rgba(150, 97, 125, 0.3);
}

.rank-3 {
    background: #4A333E;
    /* Darker purple/pink/brown */
    box-shadow: 0 4px 12px rgba(74, 51, 62, 0.3);
}

.rank-other {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Specific styling to match reference image */
.rank-2 {
    background: #9e7688;
    /* Muted mauve */
}

.rank-3 {
    background: #5a3d46;
    /* Dark brown-red */
}

.rank-other {
    background: #1a1a1a;
}

/* override gradients for 1st place to match reference better if needed, but gradient is nice */
.rank-1 {
    background: #ff69b4;
}


.leaderboard-image {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.leaderboard-rank {
    font-size: 16px;
    font-weight: 800;
    margin-right: 12px;
    min-width: 20px;
}

.leaderboard-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.vote-count-pill {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}