/* 
 * WCSvote Application Styles
 * Minimal Modern Design
 */

/* CSS Variables */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    --radius: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-header {
    margin-bottom: 2rem;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

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

.content-title {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

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

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

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

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background: rgba(79, 70, 229, 0.1); color: var(--primary-color); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success-color); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.stat-icon.info { background: rgba(59, 130, 246, 0.1); color: var(--info-color); }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
}

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

/* Navigation */
.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.nav-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

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

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

.form-control {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

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

select.form-control {
    cursor: pointer;
}

.form-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-color);
}

.table tbody tr:hover {
    background: var(--bg-color);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary { background: rgba(79, 70, 229, 0.1); color: var(--primary-color); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success-color); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger-color); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info-color); }
.badge-secondary { background: var(--bg-color); color: var(--text-muted); }

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-color) 0%, rgba(79, 70, 229, 0.05) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--bg-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-primary { color: var(--primary-color); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.02);
}

.file-upload-area i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Phase 4 Utilities (Contest Cards) */
.col-span-full { grid-column: 1 / -1; }
.p-0 { padding: 0 !important; }
.relative { position: relative; }
.h-200px { height: 200px; }
.bg-light { background: #f0f0f0; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.object-cover { object-fit: cover; }
.placeholder-gradient { background: linear-gradient(135deg, var(--primary-color), #7c3aed); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.icon-2xl { font-size: 5rem; }
.grid-cards-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-cards-xl { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 1.5rem; }

/* Phase 3 Final Additions (Modals & Form Utilities) */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 9999;
    display: flex; align-items: center; justify-content: center; overflow-y: auto;
}
.modal-content {
    width: 100%; max-width: 700px; margin: 0;
    background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-content-lg {
    width: 100%; max-width: 900px; margin: 0;
    background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
    padding: 1.5rem; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}
.modal-body {
    padding: 1.5rem; overflow-y: auto; flex: 1;
}
.modal-footer {
    padding: 1rem 1.5rem; border-top: 1px solid var(--border-color);
    display: flex; gap: 0.5rem; justify-content: flex-end; flex-shrink: 0;
}
.btn-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.5rem; color: var(--text-muted); padding: 0;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}
.btn-close:hover { color: var(--danger-color); }

.grid-cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.justify-end { justify-content: flex-end; }
.flex-shrink-0 { flex-shrink: 0; }

/* Phase 2 Additions (Dashboard & Results) */
.align-end { align-items: flex-end; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.flex-grow-1 { flex-grow: 1; }
.flex-wrap { flex-wrap: wrap; }

.text-md { font-size: 1.125rem; }
.text-xl { font-size: 1.5rem; }
.icon-3xl { font-size: 3rem; }

.mt-2 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }

.grid-cards-lg { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.card-border-lg { border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--card-bg); }
.overflow-hidden { overflow: hidden; }

.img-cover-h160 { width: 100%; height: 160px; object-fit: cover; }
.placeholder-h160 { width: 100%; height: 160px; background: linear-gradient(135deg, var(--primary-color), #7c3aed); display: flex; align-items: center; justify-content: center; }

.podium-container { display: flex; justify-content: center; align-items: flex-end; gap: 1rem; margin-bottom: 2rem; padding: 2rem; background: linear-gradient(180deg, transparent, rgba(255, 215, 0, 0.1)); border-radius: var(--radius-lg); }
.podium-stand-sm { text-align: center; width: 150px; }
.podium-stand-lg { text-align: center; width: 180px; }

.w-60px { width: 60px; }
.bg-gold-50 { background: rgba(255, 215, 0, 0.05) !important; }
.min-vh-100 { min-height: 100vh; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-weight-bold { font-weight: 700; }
.font-weight-semibold { font-weight: 600; }
.font-weight-medium { font-weight: 500; }

.text-xxs { font-size: 0.75rem; }
.text-xs { font-size: 0.8125rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.25rem; }

.icon-xl { font-size: 4rem; }
.icon-xxl { font-size: 6rem; }
.icon-lg { font-size: 2rem; }

.text-white-30 { color: rgba(255,255,255,0.3); }
.text-border { color: var(--border-color); }

.m-0 { margin: 0; }
.mr-2 { margin-right: 0.5rem; }
.mt-0 { margin-top: 0; }
.mt-5 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0; }
.mb-5 { margin-bottom: 3rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }

.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.pb-5 { padding-bottom: 3rem; }
.pt-4 { padding-top: 2rem; }
.pl-4 { padding-left: 1.5rem; }

.container-xl { max-width: 1400px; margin-left: auto; margin-right: auto; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.grid-criteria { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

.card-border { border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--card-bg); }
.bg-muted { background: var(--bg-color); }
.radius { border-radius: var(--radius); }
.d-block { display: block; }

.badge-translucent { padding: 0.5rem 1rem; background: rgba(255,255,255,0.2); font-size: 1rem; }

.placeholder-image { width: 100%; height: 350px; background: linear-gradient(135deg, var(--primary-color), #7c3aed); display: flex; align-items: center; justify-content: center; }

.locked-box { text-align: center; padding: 1rem; background: var(--bg-color); border-radius: var(--radius); margin-top: 1rem; color: var(--text-muted); }
.footer-note { text-align: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-color); }

.progress-bar-bg { background: var(--border-color); height: 10px; border-radius: 5px; overflow: hidden; }
.progress-bar-fill { background: var(--primary-color); height: 100%; transition: width 0.3s; }

.avatar-lg { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); }

