/* Modern Dark Orange Theme for STAR Voting Platform */
:root {
    --primary-color: #ff6b35;
    --primary-hover: #ff5722;
    --primary-light: #ff8a5b;
    --secondary-color: #ffa500;
    --secondary-hover: #ff8c00;
    --accent-color: #ff9f1c;
    --danger-color: #ef4444;
    --warning-color: #ffa500;
    --success-color: #4ade80;
    --background: #0a0a0a;
    --surface: #1a1a1a;
    --surface-hover: #252525;
    --surface-elevated: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #707070;
    --border: #2a2a2a;
    --border-hover: #404040;
    --gradient-primary: linear-gradient(135deg, #ff6b35 0%, #ff9f1c 100%);
    --gradient-surface: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    --shadow-sm: 0 2px 8px rgba(255, 107, 53, 0.1);
    --shadow-md: 0 4px 16px rgba(255, 107, 53, 0.15);
    --shadow-lg: 0 8px 32px rgba(255, 107, 53, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: var(--gradient-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.nav-title:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--surface-elevated);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--gradient-primary);
    box-shadow: var(--shadow-sm);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

/* Cards */
.card {
    background: var(--gradient-surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9375rem;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-hover);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: var(--surface-elevated);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', 'Monaco', 'Courier New', monospace;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Vote Options */
.vote-options {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vote-option {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.vote-option:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.option-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.score-selector {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.score-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 80px;
}

.score-bubbles {
    display: flex;
    gap: 0.625rem;
}

.score-bubble {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    cursor: pointer;
    border: 2px solid #9ca3af;
    background: #f3f4f6;
    color: #6b7280;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.score-bubble:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.score-bubble.active {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    border-color: #ff6b35;
    background: #ff6b35;
    color: white;
}

.score-bubble.active::after {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -6px;
    background: #22c55e;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 900;
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    border: 2px solid white;
}

/* All score bubbles use the same orange outline design */

/* Results */
.results-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-item {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.result-item.winner-item {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 159, 28, 0.1) 100%);
    border-color: var(--primary-color);
    border-width: 2px;
    box-shadow: var(--shadow-sm);
}

.winner-badge {
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    display: inline-block;
}

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

.result-title {
    font-weight: 500;
}

.result-score {
    font-weight: 600;
    color: var(--primary-color);
}

.result-bar {
    height: 0.75rem;
    background-color: var(--surface);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.result-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
}

.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error */
.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--danger-color);
}

/* Success */
.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--secondary-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

/* Vote Status */
.vote-status {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.vote-status.active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(255, 159, 28, 0.2) 100%);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.vote-status.ended {
    background: rgba(112, 112, 112, 0.2);
    color: var(--text-muted);
    border: 1px solid var(--border-hover);
}

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

.vote-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.vote-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.vote-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.vote-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.winner {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 2rem;
    text-align: center;
    background-color: rgba(255, 107, 53, 0.1);
    border-radius: 1rem;
    border: 2px solid var(--primary-color);
    letter-spacing: -0.5px;
}

.result-details {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.vote-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.vote-breakdown summary {
    cursor: pointer;
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    user-select: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.vote-breakdown summary:hover {
    background-color: var(--surface-hover);
}

.vote-breakdown summary::marker {
    color: var(--primary-color);
}

.breakdown-content {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: var(--background);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.breakdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.breakdown-item span:first-child {
    color: var(--text-secondary);
}

.breakdown-item span:last-child {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 2rem;
    text-align: right;
}

.tie-explanation {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tie-explanation h3 {
    color: var(--warning-color);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.tie-explanation p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.tie-explanation ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.tie-explanation li {
    padding: 0.25rem 0;
    line-height: 1.6;
}

.runoff-results {
    display: grid;
    gap: 1rem;
}

.runoff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background-color: var(--surface-elevated);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.runoff-candidate {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.candidate-name {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.candidate-votes {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.runoff-item.winner-highlight {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(255, 159, 28, 0.15) 100%);
    border-color: var(--primary-color);
    border-width: 2px;
    box-shadow: var(--shadow-sm);
}

.runoff-score {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    min-width: 3rem;
    text-align: center;
}

.runoff-explanation {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.runoff-explanation h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.runoff-explanation p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9375rem;
}

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

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero {
    text-align: center;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

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

.message.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.message.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

.message.warning {
    background-color: rgba(255, 107, 53, 0.15);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

/* Option Input */
.option-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.option-input .form-input {
    flex: 1;
}

.char-counter {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
    background: var(--surface);
    padding: 0 0.25rem;
}

.char-counter-input {
    top: 50%;
    transform: translateY(-50%);
}

.char-counter-textarea {
    top: 0.75rem;
    transform: none;
}

.duration-inputs {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.duration-inputs .form-input {
    width: 80px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Feedback Section */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-item {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: border-color 0.2s ease;
}

.feedback-item:hover {
    border-color: var(--border-hover);
}

.feedback-message {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.feedback-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
}

