:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --success-hover: #059669;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --input-bg: rgba(15, 23, 42, 0.6);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-darker);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15), transparent 25%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background animated orbs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.2);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(16, 185, 129, 0.15);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, 50px) scale(1.1); }
    100% { transform: translate(-50px, 100px) scale(0.9); }
}

.app-container {
    width: 100%;
    max-width: 1400px;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.view {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--glass-shadow);
}

.login-card {
    max-width: 480px;
    margin: 0 auto;
}

.card-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.card-header.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.shield-icon {
    width: 80px;
    height: 80px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

h1, h2 {
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

/* Dynamic Table Styles */
.dynamic-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}
.dynamic-table th, .dynamic-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: left;
    vertical-align: middle;
}
.dynamic-table th {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.dynamic-table input,
.dynamic-table select {
    padding: 0.6rem;
    font-size: 0.9rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    width: 100%;
}
.dynamic-table select option {
    background: var(--bg-card);
    color: var(--text-light);
}
.dynamic-table .btn-remove {
    color: #ef4444;
    padding: 0.4rem;
}
.dynamic-table .btn-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* Admin panel styles */
.admin-card {
    max-width: 800px;
    margin: 0 auto;
}

.leader-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leader-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leader-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.leader-name-display {
    font-weight: 600;
    color: var(--primary);
}

.leader-city-display {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.form-section h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.half-width {
    flex: 1;
}

.hint-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.sub-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

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

input, select, textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

input::placeholder, textarea::placeholder {
    color: #475569;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    gap: 0.5rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    transition: transform 0.2s;
}

.btn:hover .btn-icon {
    transform: translateX(3px);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-icon-only {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.fade-out {
    animation: fadeOutRight 0.4s forwards;
}

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

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

/* Utilities & Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Responsive */
@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
    }
    
    .form-row, .stats-grid {
        flex-direction: column;
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-content {
    background: var(--bg-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}
.modal-content h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.5rem;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}
