:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #15151f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.3);
    --danger: #ff4757;
    --warning: #ffa502;
    --info: #3498db;
    --border: #2a2a3a;
    --gradient: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

code, .mono {
    font-family: 'JetBrains Mono', monospace;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.brand-underscore {
    color: var(--accent);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s;
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.nav-auth {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--accent);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

select.form-input {
    cursor: pointer;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: var(--bg-tertiary);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent);
}

.badge-danger {
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(255, 165, 2, 0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(52, 152, 219, 0.1);
    color: var(--info);
}

/* Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.container-sm {
    max-width: 500px;
}

.container-md {
    max-width: 800px;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Home Page */
.hero {
    text-align: center;
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Challenge Cards */
.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.challenge-card {
    position: relative;
    cursor: pointer;
}

.challenge-card.solved {
    border-color: var(--accent);
}

.challenge-card.solved::before {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

.challenge-category {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.challenge-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.challenge-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.challenge-points {
    color: var(--accent);
    font-weight: 600;
}

/* Category Section */
.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Scoreboard */
.scoreboard-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.scoreboard-tab {
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.scoreboard-tab:hover, .scoreboard-tab.active {
    border-color: var(--accent);
    color: var(--accent);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.rank-1 { background: gold; color: black; }
.rank-2 { background: silver; color: black; }
.rank-3 { background: #cd7f32; color: black; }
.rank-default { background: var(--bg-tertiary); color: var(--text-secondary); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover, .pagination-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-success { border-color: var(--accent); }
.toast-error { border-color: var(--danger); }
.toast-info { border-color: var(--info); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Admin */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 70px);
}

.admin-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-nav-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.admin-nav-item:hover, .admin-nav-item.active {
    background: var(--bg-tertiary);
    color: var(--accent);
}

.admin-content {
    padding: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stat-card {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* User/Team Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bg-primary);
}

.profile-info h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.profile-stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding-top: 1rem;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-auth {
        display: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .container {
        padding: 1rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { justify-content: center; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Notification Badge */
.notif-btn {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Enhanced Profile Styles */
.profile-card {
    padding: 2rem;
}

.profile-header-main {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.profile-main-info {
    flex: 1;
}

.profile-username {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.profile-bio {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.profile-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.profile-link:hover {
    color: var(--accent);
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.profile-stat-box {
    text-align: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.profile-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.profile-stat-box .profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.profile-stat-box .profile-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.team-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-top: 1rem;
    transition: all 0.2s;
}

.team-link-card:hover {
    background: var(--bg-secondary);
}

.team-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--bg-primary);
}

.team-name {
    font-weight: 600;
    color: var(--text-primary);
}

.score-chart {
    height: 150px;
    margin-top: 1rem;
}

.solves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.solve-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid var(--accent);
}

.solve-category {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.solve-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.solve-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.solve-points {
    color: var(--accent);
    font-weight: 600;
}

.solve-time {
    color: var(--text-muted);
}

/* Code Editor Styles */
.code-editor-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.code-tab {
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.code-tab:hover, .code-tab.active {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
}

.code-editor-card {
    border-radius: 0 8px 8px 8px;
}

.code-textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
}

.code-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.code-reference {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-secondary);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Responsive Profile */
@media (max-width: 768px) {
    .profile-header-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-links {
        justify-content: center;
    }
}

/* Team Styles */
.team-avatar-large {
    background: linear-gradient(135deg, var(--accent) 0%, #0066ff 100%);
}

.invite-card {
    border: 1px dashed var(--accent);
    background: rgba(0, 255, 136, 0.05);
}

.invite-code-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.invite-code {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 2px;
}

.invite-link-box {
    display: flex;
    gap: 0.5rem;
}

.invite-link-box .form-input {
    flex: 1;
    font-size: 0.85rem;
}

.team-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.team-member-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: all 0.2s;
}

.team-member-card:hover {
    background: var(--bg-secondary);
}

.member-avatar {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.captain-badge {
    font-size: 0.75rem;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.member-score {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.member-actions {
    display: flex;
    gap: 0.25rem;
}

.member-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

/* Highlight row for own team */
.highlight-row {
    background: rgba(0, 255, 136, 0.05) !important;
    border-left: 3px solid var(--accent);
}

.highlight-row:hover {
    background: rgba(0, 255, 136, 0.1) !important;
}

/* Banned row styling */
.row-banned {
    background: rgba(255, 71, 87, 0.1) !important;
    border-left: 3px solid var(--danger);
}

.row-banned:hover {
    background: rgba(255, 71, 87, 0.15) !important;
}

.row-empty-team {
    background: rgba(255, 193, 7, 0.1) !important;
    border-left: 3px solid var(--warning);
}

.row-empty-team:hover {
    background: rgba(255, 193, 7, 0.15) !important;
}

/* Modal improvements */
.modal-lg {
    max-width: 700px;
    width: 95%;
}

/* Form grid layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Score frozen indicator */
.frozen-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 165, 2, 0.1);
    border: 1px solid var(--warning);
    border-radius: 8px;
    color: var(--warning);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Attempt counter */
.attempts-indicator {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.attempts-indicator.warning {
    background: rgba(255, 165, 2, 0.2);
    color: var(--warning);
}

.attempts-indicator.danger {
    background: rgba(255, 71, 87, 0.2);
    color: var(--danger);
}

/* Challenge author */
.challenge-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Score graph container */
.score-graph-container {
    width: 100%;
    height: 400px;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

/* CTF status banner */
.ctf-status-banner {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

.ctf-status-banner.upcoming {
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.2) 0%, rgba(52, 152, 219, 0.1) 100%);
    border: 1px solid var(--info);
    color: var(--info);
}

.ctf-status-banner.running {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 255, 136, 0.1) 100%);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.ctf-status-banner.ended {
    background: linear-gradient(90deg, rgba(255, 71, 87, 0.2) 0%, rgba(255, 71, 87, 0.1) 100%);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* File upload improvements */
.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.file-upload-btn input[type="file"] {
    display: none;
}

/* Admin nav improvements */
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.admin-nav-item:hover {
    background: var(--bg-tertiary);
}

.admin-nav-item.active {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
}

/* Settings cards */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Better button variants */
.btn-success {
    background: #2ecc71;
    color: #fff;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-warning:hover {
    background: #e09400;
}

/* CTF countdown timer */
.countdown-timer {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.countdown-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    min-width: 80px;
}

.countdown-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.countdown-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ===============================================
   ENHANCED CYBER THEME WITH SMOOTH TRANSITIONS
   =============================================== */

/* Animated background grid pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(0, 255, 136, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* Smooth page transitions */
.page-content {
    animation: fadeSlideIn 0.3s ease-out;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced card hover effects */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 255, 136, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Glowing accent border effect */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, var(--accent) 50%, transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover::after {
    opacity: 0.5;
}

.card {
    position: relative;
    overflow: hidden;
}

/* Button glow effects */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    box-shadow: 
        0 5px 30px var(--accent-glow),
        0 0 60px rgba(0, 255, 136, 0.2);
}

/* Enhanced form inputs */
.form-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(26, 26, 37, 0.8);
}

.form-input:focus {
    background: var(--bg-tertiary);
    box-shadow: 
        0 0 0 3px var(--accent-glow),
        0 0 20px rgba(0, 255, 136, 0.1);
    transform: translateY(-1px);
}

/* Navbar enhancement */
.navbar {
    backdrop-filter: blur(20px);
    background: rgba(18, 18, 26, 0.9);
    transition: all 0.3s ease;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}

/* Challenge card enhancements */
.challenge-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.challenge-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(0, 255, 136, 0.15);
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.challenge-card:hover::before {
    opacity: 1;
}

/* Table row animations */
table tbody tr {
    transition: all 0.2s ease;
}

table tbody tr:hover {
    background: rgba(0, 255, 136, 0.05);
    box-shadow: inset 3px 0 0 var(--accent);
}

/* Badge pulse for live/active items */
.badge-live {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 0 8px transparent; }
}

/* Modal enhancements */
.modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    background: rgba(21, 21, 31, 0.95);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-overlay {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scoreboard rank styling */
.rank-1 { 
    color: #ffd700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-weight: 700;
}

.rank-2 { 
    color: #c0c0c0 !important;
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
    font-weight: 600;
}

.rank-3 { 
    color: #cd7f32 !important;
    text-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
    font-weight: 600;
}

/* Score graph styling */
.score-graph-container {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(21, 21, 31, 0.8) 100%);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.score-graph-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* Stats cards */
.stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 255, 136, 0.05) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero section enhancement */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(-10%, -10%); }
    100% { transform: translate(10%, 10%); }
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Copy button feedback */
.copy-success {
    animation: copyFlash 0.5s ease;
}

@keyframes copyFlash {
    0%, 100% { background: var(--bg-tertiary); }
    50% { background: rgba(0, 255, 136, 0.2); }
}

/* Team invite code display */
.invite-code {
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(90deg, var(--bg-tertiary), rgba(0, 255, 136, 0.1));
    border: 1px dashed var(--accent);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.invite-code code {
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: 2px;
}

/* Admin panel tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.admin-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: transparent;
}

.admin-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.admin-tab.active {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dim);
}

/* Selection styling */
::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Text glow effect for important elements */
.text-glow {
    text-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent-glow);
}

/* Notification dot */
.notification-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: notificationPulse 2s infinite;
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Info box styling */
.info-box {
    position: relative;
    overflow: hidden;
}

.info-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--info);
}

/* Success/Error toast animations */
.toast {
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Disabled state */
.disabled, [disabled] {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(50%);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===============================================
   DIGITAL COUNTDOWN TIMER
   =============================================== */

.ctf-countdown {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 0, 0, 0.8) 100%);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 2rem;
    margin: 0 auto 2rem;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.2), inset 0 0 60px rgba(0, 255, 136, 0.05);
    position: relative;
    overflow: hidden;
}

.ctf-countdown::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
    animation: countdownGlow 4s ease-in-out infinite alternate;
}

@keyframes countdownGlow {
    0% { transform: translate(-10%, -10%) rotate(0deg); }
    100% { transform: translate(10%, 10%) rotate(180deg); }
}

.ctf-countdown.ctf-running {
    border-color: #ffa502;
    box-shadow: 0 0 40px rgba(255, 165, 2, 0.2), inset 0 0 60px rgba(255, 165, 2, 0.05);
}

.ctf-countdown.ctf-running::before {
    background: radial-gradient(circle, rgba(255, 165, 2, 0.1) 0%, transparent 50%);
}

.ctf-countdown.ctf-ended {
    border-color: var(--danger);
    box-shadow: 0 0 40px rgba(255, 71, 87, 0.2);
}

.ctf-countdown .countdown-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.ctf-countdown.ctf-running .countdown-label {
    color: #ffa502;
}

.ctf-countdown.ctf-ended .countdown-label {
    color: var(--danger);
    font-size: 1.5rem;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.countdown-item {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
}

.countdown-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
    line-height: 1;
    animation: digitPulse 1s ease-in-out infinite;
}

@keyframes digitPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.ctf-countdown.ctf-running .countdown-value {
    color: #ffa502;
    text-shadow: 0 0 20px rgba(255, 165, 2, 0.5), 0 0 40px rgba(255, 165, 2, 0.3);
}

.countdown-unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

@media (max-width: 600px) {
    .countdown-timer {
        gap: 0.5rem;
    }
    .countdown-item {
        padding: 0.75rem 1rem;
        min-width: 70px;
    }
    .countdown-value {
        font-size: 1.8rem;
    }
}

/* Custom challenges header for injected code */
.custom-challenges-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.custom-challenges-header * {
    pointer-events: none;
}

/* ===============================================
   FIXED RIGHT SIDE TIMER
   =============================================== */

.fixed-timer {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(10, 10, 15, 0.95) 100%);
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.3), 0 0 80px rgba(0, 255, 136, 0.1);
    backdrop-filter: blur(20px);
    min-width: 120px;
}

.fixed-timer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent), transparent, var(--accent));
    border-radius: 16px;
    z-index: -1;
    animation: timerBorderGlow 3s ease-in-out infinite;
    opacity: 0.5;
}

@keyframes timerBorderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Large countdown for pre-CTF page */
.ctf-countdown-center {
    text-align: center;
}

.countdown-timer-large {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.countdown-item-lg {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
}

.countdown-value-lg {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow), 0 0 60px var(--accent-glow);
    line-height: 1;
}

.countdown-unit-lg {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .countdown-timer-large {
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    .countdown-item-lg {
        padding: 1rem 1.5rem;
        min-width: 80px;
    }
    .countdown-value-lg {
        font-size: 2rem;
    }
}

.fixed-timer.timer-ending {
    border-color: var(--timer-glow-color, #ffa502);
    box-shadow: 0 0 40px var(--timer-glow-shadow, rgba(255, 165, 2, 0.3)), 0 0 80px var(--timer-glow-shadow-light, rgba(255, 165, 2, 0.1));
}

.fixed-timer.timer-ending::before {
    background: linear-gradient(45deg, var(--timer-glow-color, #ffa502), transparent, var(--timer-glow-color, #ffa502));
}

.fixed-timer.timer-ended {
    border-color: var(--danger);
    box-shadow: 0 0 40px rgba(255, 71, 87, 0.3);
}

.fixed-timer .timer-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    white-space: nowrap;
}

.fixed-timer.timer-ending .timer-label {
    color: var(--timer-glow-color, #ffa502);
}

.fixed-timer.timer-ended .timer-label {
    color: var(--danger);
}

.fixed-timer .timer-digits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fixed-timer .timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fixed-timer .timer-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    line-height: 1;
}

.fixed-timer.timer-ending .timer-value {
    color: var(--timer-glow-color, #ffa502);
    text-shadow: 0 0 20px var(--timer-glow-shadow, rgba(255, 165, 2, 0.5));
}

.fixed-timer .timer-text {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .fixed-timer {
        right: 10px;
        padding: 1rem 0.75rem;
        min-width: 80px;
    }
    .fixed-timer .timer-value {
        font-size: 1.4rem;
    }
}

/* ===============================================
   FALLING STARS EFFECT FOR CHALLENGES PAGE
   =============================================== */

/* Particle container */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particles-container .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(0, 255, 136, 0.5);
    animation: particleFall linear infinite;
}

@keyframes particleFall {
    0% { 
        transform: translateY(-10px) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(100vh) scale(0.5); 
        opacity: 0; 
    }
}

/* Different particle speeds */
.particles-container .particle:nth-child(odd) { animation-duration: 4s; }
.particles-container .particle:nth-child(even) { animation-duration: 6s; }
.particles-container .particle:nth-child(3n) { animation-duration: 5s; }
.particles-container .particle:nth-child(5n) { 
    background: #00ccff;
    box-shadow: 0 0 10px #00ccff, 0 0 20px rgba(0, 204, 255, 0.5);
}
.particles-container .particle:nth-child(7n) { 
    background: #a855f7;
    box-shadow: 0 0 10px #a855f7, 0 0 20px rgba(168, 85, 247, 0.5);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 28px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid var(--border-color);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    left: calc(100% - 24px);
    background: white;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.3);
}

/* Cross-environment compatibility */
img, video, svg { max-width: 100%; height: auto; }
html { -webkit-text-size-adjust: 100%; }
.form-input, select.form-input, textarea.form-input { font-size: 16px; }
.card, .modal, .profile-card { overflow-wrap: break-word; }
