/**
 * DK Vote - Liquid Glass Theme
 * iOS 26 Style - Frosted Glass, Blur, Translucent Layers
 * Mobile-first design (max-width: 480-576px)
 */

:root {
    /* Color Palette - iOS 26 Liquid Glass */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-bg-light: rgba(255, 255, 255, 0.25);
    --glass-bg-dark: rgba(0, 0, 0, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: rgba(0, 0, 0, 0.1);
    
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #434343 0%, #000000 100%);
    
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #ffffff;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px var(--glass-shadow);
    --shadow-md: 0 4px 16px var(--glass-shadow);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
    padding: var(--spacing-sm);
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: backgroundPulse 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Container */
.container {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.glass-card-small {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) 0;
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--spacing-xs);
}

.app-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Form Elements */
.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-control:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
    box-shadow: var(--shadow-md);
}

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

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-light);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--glass-bg-light);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-success {
    background: var(--success-gradient);
    color: var(--text-light);
}

.btn-link {
    background: transparent;
    color: var(--text-light);
    text-decoration: underline;
    box-shadow: none;
}

/* Vote Selector */
.vote-selector {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.vote-option {
    flex: 1;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    color: var(--text-light);
    font-weight: 600;
}

.vote-option:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.vote-option.active {
    background: var(--primary-gradient);
    border-color: var(--text-light);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

/* Act Item */
.act-item {
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.act-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(4px);
}

.act-item.selected {
    background: var(--primary-gradient);
    border-color: var(--text-light);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.act-item.act-voted {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.3);
}

.act-item.act-voted:hover {
    background: rgba(74, 222, 128, 0.2);
    transform: none;
}

.act-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.act-item-title {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.act-item-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Results */
.result-item {
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    backdrop-filter: blur(10px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.result-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    min-width: 40px;
}

.result-info {
    flex: 1;
    margin: 0 var(--spacing-sm);
}

.result-team {
    font-weight: 600;
    color: var(--text-light);
}

.result-act {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.result-votes {
    text-align: right;
}

.result-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
}

.result-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-top: var(--spacing-xs);
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.25);
    color: var(--text-light);
    backdrop-filter: blur(10px);
}

.badge-success {
    background: var(--success-gradient);
}

.badge-warning {
    background: var(--secondary-gradient);
}

/* Alerts */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.alert-success {
    background: rgba(79, 172, 254, 0.2);
    color: var(--text-light);
}

.alert-error {
    background: rgba(245, 87, 108, 0.2);
    color: var(--text-light);
}

.alert-info {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

/* Loading */
.loading {
    text-align: center;
    padding: var(--spacing-xl);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--spacing-sm);
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--text-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* Utilities */
.text-center { text-align: center; }
.text-light { color: var(--text-light); }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 360px) {
    .app-title { font-size: 1.5rem; }
    .glass-card { padding: var(--spacing-md); }
    .stats-grid { grid-template-columns: 1fr; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Trophy Icon for Top 3 */
.result-rank.trophy::before {
    content: '🏆 ';
}

.result-rank.trophy-2::before {
    content: '🥈 ';
}

.result-rank.trophy-3::before {
    content: '🥉 ';
}
