:root {
    --primary: #6366f1;
    --secondary: #a855f7;
    --accent: #22d3ee;
    --background: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--background);
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a 40%),
                radial-gradient(circle at bottom left, #312e81, #0f172a 40%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-md);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
    margin-bottom: 40px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

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

/* Login/Portal selector Page */
.hero {
    text-align: center;
    padding: 100px 20px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.portal-card {
    padding: 40px;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.portal-card:hover {
    transform: translateY(-15px);
}

.portal-card i {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    color: var(--accent);
}

/* Card design for projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.project-card {
    padding: 25px;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card h3 {
    margin-bottom: 10px;
    line-height: 1.3;
}

.team-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.85rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 20px;
    margin-bottom: 15px;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.vote-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.vote-btn {
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    transition: all 0.2s;
}

.vote-btn.best:hover:not(:disabled) { background: #22c55e; color: white; border-color: #22c55e; }
.vote-btn.good:hover:not(:disabled) { background: #eab308; color: white; border-color: #eab308; }
.vote-btn.moderate:hover:not(:disabled) { background: #ef4444; color: white; border-color: #ef4444; }

.vote-btn.active.best { background: #22c55e; color: white; }
.vote-btn.active.good { background: #eab308; color: white; }
.vote-btn.active.moderate { background: #ef4444; color: white; }

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

/* Login Forms */
.auth-container {
    max-width: 450px;
    margin: 80px auto;
    padding: 50px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 15px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Toast Notification Styling */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.toast {
    padding: 15px 30px;
    margin-top: 10px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideIn 0.3s forwards ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* Progress bar */
.voting-progress-bar {
    height: 12px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    width: 0%;
    transition: width 1s ease-in-out;
}

/* Admin Dashboard Table & Chart Container */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.chart-container {
    margin-bottom: 40px;
    padding: 30px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 25px;
    text-align: center;
}

.stat-card h4 {
    font-size: 2rem;
    color: var(--accent);
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    padding: 40px;
}

/* Animations */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Responsive fixes */
@media (max-width: 768px) {
    .nav-links { gap: 10px; }
    .hero-h1 { font-size: 2.8rem !important; }
    nav { width: calc(100% - 20px) !important; padding: 10px 20px !important; }
}

/* leaderboard list item */
.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--glass-border);
}
.leaderboard-item:last-child { border-bottom: none; }
