/* World of Warcraft Theme */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&display=swap');

:root {
    --wow-bg: #1a1a1a;
    --wow-bg-darker: #0d0d0d;
    --wow-gold: #c9a227;
    --wow-gold-light: #ffd700;
    --wow-gold-dark: #8b6914;
    --wow-border: #4a3c28;
    --wow-border-light: #6b5a3c;
    --wow-text: #e6d5a8;
    --wow-text-muted: #8b8068;
    --wow-red: #c41f3b;
    --wow-green: #00ff00;
    --wow-blue: #0070dd;
    --wow-purple: #a335ee;
    --wow-orange: #ff8000;

    /* Class colors */
    --class-warrior: #c79c6e;
    --class-paladin: #f58cba;
    --class-hunter: #abd473;
    --class-rogue: #fff569;
    --class-priest: #ffffff;
    --class-shaman: #0070de;
    --class-mage: #69ccf0;
    --class-warlock: #9482c9;
    --class-druid: #ff7d0a;
    --class-deathknight: #c41f3b;
    --class-monk: #00ff96;
    --class-demonhunter: #a330c9;
    --class-evoker: #33937f;
}

* {
    box-sizing: border-box;
}

/* Remove focus outlines */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--wow-gold-dark);
    outline-offset: 2px;
}

html, body {
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
    background-attachment: fixed;
    color: var(--wow-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ornamental background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.8) 100%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L30 60M0 30L60 30' stroke='%234a3c28' stroke-width='0.5' fill='none' opacity='0.3'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--wow-gold);
    text-decoration: none;
    transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
    color: var(--wow-gold-light);
    text-shadow: 0 0 10px var(--wow-gold);
}

/* Page Layout */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 1.5rem 1rem;
    padding-top: 70px;
    background: linear-gradient(180deg, #2a2218 0%, #1a1510 100%);
    border-bottom: 2px solid var(--wow-gold-dark);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 -1px 0 var(--wow-border-light);
    overflow: visible;
    z-index: 100;
}

.brand {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    z-index: 101;
}

.brand:hover {
    text-decoration: none;
}

.guild-logo {
    height: 130px;
    width: auto;
    border-radius: 10px;
    border: 4px solid var(--wow-gold-dark);
    box-shadow: 0 6px 30px rgba(0,0,0,0.9), 0 0 40px rgba(201, 162, 39, 0.3);
    transition: all 0.3s;
    background: linear-gradient(180deg, #2a2218 0%, #1a1510 100%);
}

.guild-logo:hover {
    border-color: var(--wow-gold);
    box-shadow: 0 6px 35px rgba(0,0,0,0.9), 0 0 50px rgba(201, 162, 39, 0.5);
    transform: scale(1.03);
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.main-nav {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    min-width: 0;
}

.main-nav a {
    color: var(--wow-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.main-nav a:hover {
    color: var(--wow-gold);
    border-color: var(--wow-gold-dark);
    background: rgba(201, 162, 39, 0.1);
}

.main-content {
    flex: 1;
    padding: 3.5rem 2rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* WoW Style Panel */
.wow-panel {
    background: linear-gradient(180deg, rgba(42, 34, 24, 0.95) 0%, rgba(26, 21, 16, 0.95) 100%);
    border: 2px solid var(--wow-border);
    border-radius: 4px;
    box-shadow:
        0 0 20px rgba(0,0,0,0.8),
        inset 0 1px 0 var(--wow-border-light),
        inset 0 -1px 0 rgba(0,0,0,0.5);
    position: relative;
}

.wow-panel::before,
.wow-panel::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--wow-gold-dark);
}

.wow-panel::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.wow-panel::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

/* Login Display */
.login-display {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 2px solid var(--wow-gold-dark);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.username {
    font-weight: 600;
    color: var(--wow-gold);
    font-size: 0.95rem;
}

.role-status {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    font-family: Arial, sans-serif;
}

.role-valid {
    background: linear-gradient(180deg, #1a4d1a 0%, #0d260d 100%);
    border: 1px solid var(--wow-green);
    color: var(--wow-green);
    text-shadow: 0 0 5px var(--wow-green);
}

.role-invalid {
    background: linear-gradient(180deg, #4d1a1a 0%, #260d0d 100%);
    border: 1px solid var(--wow-red);
    color: var(--wow-red);
}

.role-loading {
    background: var(--wow-bg);
    border: 1px solid var(--wow-border);
    color: var(--wow-text-muted);
}

.logout-link {
    margin-left: 1.5rem;
    color: var(--wow-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logout-link:hover {
    color: var(--wow-red);
}

/* Discord Login Button - WoW Style */
.discord-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(180deg, #5865f2 0%, #4752c4 50%, #3c45a5 100%);
    border: 2px solid #7289da;
    border-radius: 4px;
    color: white;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.discord-login-btn:hover {
    background: linear-gradient(180deg, #6875f5 0%, #5865f2 50%, #4752c4 100%);
    border-color: #99aab5;
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.6), inset 0 1px 0 rgba(255,255,255,0.3);
    transform: translateY(-1px);
    text-decoration: none;
}

.discord-login-btn svg {
    width: 22px;
    height: 22px;
}

/* WoW Gold Button */
.wow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background: linear-gradient(180deg, #5a4a2a 0%, #3a2a1a 50%, #2a1a0a 100%);
    border: 2px solid var(--wow-gold-dark);
    border-radius: 4px;
    color: var(--wow-gold);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), inset 0 1px 0 var(--wow-border-light);
}

.wow-btn:hover {
    background: linear-gradient(180deg, #6a5a3a 0%, #4a3a2a 50%, #3a2a1a 100%);
    border-color: var(--wow-gold);
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.3), inset 0 1px 0 var(--wow-gold-dark);
    text-shadow: 0 0 10px var(--wow-gold);
}

.wow-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Home Page */
.home-container {
    text-align: center;
    padding: 2rem;
}

.home-container h1 {
    font-size: 2.5rem;
    color: var(--wow-gold);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 30px rgba(201, 162, 39, 0.4);
    margin-bottom: 0.5rem;
    letter-spacing: 3px;
}

.home-container .subtitle {
    color: var(--wow-text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Standings on Home */
.standings-section {
    margin: 2rem 0;
}

.standings-section h2 {
    color: var(--wow-gold);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.standings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}

.standing-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, rgba(42, 34, 24, 0.9) 0%, rgba(26, 21, 16, 0.9) 100%);
    border: 1px solid var(--wow-border);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.standing-item .rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wow-gold);
    width: 40px;
    text-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
}

.standing-item .rank.first { color: #ffd700; }
.standing-item .rank.second { color: #c0c0c0; }
.standing-item .rank.third { color: #cd7f32; }

.standing-item .officer-info {
    flex: 1;
    text-align: left;
    margin-left: 1rem;
}

.standing-item .officer-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.standing-item .officer-class {
    font-size: 0.8rem;
    opacity: 0.8;
}

.standing-item .vote-count {
    font-size: 1.2rem;
    color: var(--wow-text-muted);
}

.standing-item .progress-bg {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.2) 0%, transparent 100%);
    z-index: 0;
    transition: width 0.5s ease;
}

.standing-item > * {
    position: relative;
    z-index: 1;
}

/* Vote Page */
.vote-container {
    max-width: 600px;
    margin: 0 auto;
}

.vote-container h1 {
    text-align: center;
    color: var(--wow-gold);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

.vote-container .vote-subtitle {
    text-align: center;
    color: var(--wow-text-muted);
    margin-bottom: 2rem;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--wow-text-muted);
    font-size: 1.2rem;
}

.error-box {
    background: linear-gradient(180deg, rgba(77, 26, 26, 0.9) 0%, rgba(38, 13, 13, 0.9) 100%);
    border: 2px solid var(--wow-red);
    border-radius: 4px;
    padding: 2rem;
    text-align: center;
}

.error-box h2 {
    color: var(--wow-red);
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Officer Cards */
.officer-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.officer-card {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, rgba(42, 34, 24, 0.95) 0%, rgba(26, 21, 16, 0.95) 100%);
    border: 2px solid var(--wow-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.officer-card:hover {
    border-color: var(--wow-gold-dark);
    background: linear-gradient(180deg, rgba(52, 44, 34, 0.95) 0%, rgba(36, 31, 26, 0.95) 100%);
    box-shadow: 0 0 20px rgba(201, 162, 39, 0.2);
}

.officer-card.selected {
    border-color: var(--wow-gold);
    box-shadow: 0 0 30px rgba(201, 162, 39, 0.4), inset 0 0 20px rgba(201, 162, 39, 0.1);
}

.officer-card .class-icon {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    border: 2px solid var(--wow-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 1rem;
}

.officer-card .officer-info {
    flex: 1;
}

.officer-card .officer-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.officer-card .officer-class {
    font-size: 0.85rem;
    opacity: 0.8;
}

.officer-card .select-indicator {
    width: 24px;
    height: 24px;
    border: 2px solid var(--wow-border);
    border-radius: 50%;
    transition: all 0.3s;
}

.officer-card.selected .select-indicator {
    border-color: var(--wow-gold);
    background: var(--wow-gold);
    box-shadow: 0 0 10px var(--wow-gold);
}

/* Class colors for officer names */
.class-warrior { color: var(--class-warrior) !important; }
.class-paladin { color: var(--class-paladin) !important; }
.class-hunter { color: var(--class-hunter) !important; }
.class-rogue { color: var(--class-rogue) !important; }
.class-priest { color: var(--class-priest) !important; }
.class-shaman { color: var(--class-shaman) !important; }
.class-mage { color: var(--class-mage) !important; }
.class-warlock { color: var(--class-warlock) !important; }
.class-druid { color: var(--class-druid) !important; }
.class-deathknight { color: var(--class-deathknight) !important; }
.class-monk { color: var(--class-monk) !important; }
.class-demonhunter { color: var(--class-demonhunter) !important; }
.class-evoker { color: var(--class-evoker) !important; }

/* Results */
.results-container {
    text-align: center;
}

.results-container h2 {
    color: var(--wow-green);
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.vote-info {
    color: var(--wow-text-muted);
    margin-bottom: 2rem;
    font-style: italic;
}

.results-container h3 {
    color: var(--wow-gold);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.result-item {
    background: linear-gradient(180deg, rgba(42, 34, 24, 0.95) 0%, rgba(26, 21, 16, 0.95) 100%);
    border: 1px solid var(--wow-border);
    border-radius: 4px;
    padding: 1rem 1.25rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-header .officer-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.vote-count {
    color: var(--wow-text-muted);
    font-size: 0.9rem;
}

.progress-bar {
    height: 8px;
    background: var(--wow-bg-darker);
    border: 1px solid var(--wow-border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wow-gold-dark) 0%, var(--wow-gold) 50%, var(--wow-gold-dark) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
}

.total-votes {
    margin-top: 1.5rem;
    color: var(--wow-text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Auth Message */
.auth-message {
    text-align: center;
    padding: 3rem;
    max-width: 450px;
    margin: 2rem auto;
}

.auth-message h2 {
    color: var(--wow-gold);
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.auth-message p {
    color: var(--wow-text-muted);
    margin-bottom: 1.5rem;
}

/* Error UI */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(180deg, #4d1a1a 0%, #260d0d 100%);
    border-top: 2px solid var(--wow-red);
    color: white;
    text-align: center;
    z-index: 1000;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    color: var(--wow-gold);
    margin-left: 1rem;
}

/* Responsive */
@media (max-width: 900px) {
    .top-bar {
        padding: 0 1rem 0.75rem;
        padding-top: 60px;
    }

    .guild-logo {
        height: 110px;
    }

    .main-nav {
        gap: 1rem;
    }

    .main-nav a {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 650px) {
    .page {
        overflow-x: hidden;
    }

    .top-bar {
        flex-wrap: wrap;
        align-items: center;
        padding: 0.75rem 1rem;
        padding-top: 0.75rem;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .brand {
        position: static;
        transform: none;
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .guild-logo {
        height: 110px;
    }

    .main-nav {
        order: 1;
        flex: none;
        gap: 1rem;
    }

    .main-nav a {
        font-size: 0.85rem;
        padding: 0.3rem 0.5rem;
    }

    .header-right {
        order: 2;
        flex: none;
    }

    .login-display .user-info {
        gap: 0.5rem;
    }

    .login-display .username {
        display: none;
    }

    .login-display .user-details {
        display: none;
    }

    .login-display .logout-link {
        margin-left: 0.5rem;
        font-size: 0.7rem;
    }

    .home-container h1 {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .standings-section {
        padding: 1rem !important;
    }

    .standing-item {
        padding: 0.75rem 1rem;
    }
}
