/* CTF Contest Base Styles - Centralized Design System */
:root {
    --ctf-primary: #10b981;
    --ctf-primary-dark: #059669;
    --ctf-primary-light: #34d399;
    --ctf-secondary: #64748b;
    --ctf-accent: #059669;
    --ctf-success: #10b981;
    --ctf-warning: #f59e0b;
    --ctf-danger: #ef4444;

    --ctf-bg: #0f172a;
    --ctf-bg-card: #1e293b;
    --ctf-bg-hover: #334155;
    --ctf-bg-light: #475569;

    --ctf-text: #f8fafc;
    --ctf-text-secondary: #cbd5e1;
    --ctf-text-muted: #64748b;
    --ctf-text-dark: #1e293b;

    --ctf-border: #334155;
    --ctf-border-light: #475569;

    --ctf-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --ctf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --ctf-space-1: 0.25rem;
    --ctf-space-2: 0.5rem;
    --ctf-space-3: 0.75rem;
    --ctf-space-4: 1rem;
    --ctf-space-6: 1.5rem;
    --ctf-space-8: 2rem;
    --ctf-space-12: 3rem;

    --ctf-radius: 0.5rem;
    --ctf-radius-lg: 0.75rem;
    --ctf-radius-xl: 1rem;

    --ctf-transition: all 0.2s ease;

    --ctf-bg: #0a0a0a;
    --ctf-bg-hover: #101010;
    --ctf-text: #00ff7f;
    --ctf-accent: #39ff14;
    --ctf-border: #00ff7f;
}

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

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

/* Header Styles */
.ctf-header {
    background: var(--ctf-bg-card);
    border-bottom: 1px solid var(--ctf-border);
    box-shadow: var(--ctf-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    backdrop-filter: blur(5px);
}

.ctf-header .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--ctf-primary) !important;
    text-decoration: none;
}

.ctf-header .navbar-brand:hover {
    color: var(--ctf-primary-dark) !important;
}

.ctf-header .nav-link {
    color: var(--ctf-text-secondary) !important;
    font-weight: 500;
    padding: var(--ctf-space-3) var(--ctf-space-4) !important;
    border-radius: var(--ctf-radius);
    transition: var(--ctf-transition);
    text-decoration: none;
}

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

.ctf-header .nav-link.active {
    color: var(--ctf-primary) !important;
    background: rgba(59, 130, 246, 0.1);
}

/* User Menu */
.user-menu {
    background: var(--ctf-bg-card);
    border: 1px solid var(--ctf-border);
    border-radius: var(--ctf-radius-lg);
    box-shadow: var(--ctf-shadow-lg);
}

.user-menu .dropdown-item {
    color: var(--ctf-text-secondary);
    transition: var(--ctf-transition);
}

.user-menu .dropdown-item:hover {
    background: var(--ctf-bg-hover);
    color: var(--ctf-text);
}

/* Main Content */
.ctf-main {
    min-height: calc(100vh - 200px);
    padding: var(--ctf-space-8) 0;
}

/* Card Styles */
.ctf-card {
    background: var(--ctf-bg-card);
    border: 1px solid var(--ctf-border);
    border-radius: var(--ctf-radius-lg);
    box-shadow: var(--ctf-shadow);
    transition: var(--ctf-transition);
}

.ctf-card:hover {
    border-color: var(--ctf-primary);
    box-shadow: var(--ctf-shadow-lg);
}

.ctf-card .card-header {
    background: var(--ctf-bg-card);
    border-bottom: 1px solid var(--ctf-border);
    font-weight: 600;
    color: var(--ctf-text);
}

.ctf-card .card-body {
    padding: var(--ctf-space-6);
}

/* Button Styles */
.btn-ctf {
    background: var(--ctf-primary);
    border: none;
    color: white;
    font-weight: 500;
    padding: var(--ctf-space-3) var(--ctf-space-6);
    border-radius: var(--ctf-radius);
    transition: var(--ctf-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--ctf-space-2);
}

.btn-ctf:hover {
    background: var(--ctf-primary-dark);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-ctf-outline {
    background: transparent;
    border: 1px solid var(--ctf-border);
    color: var(--ctf-text-secondary);
    font-weight: 500;
    padding: var(--ctf-space-3) var(--ctf-space-6);
    border-radius: var(--ctf-radius);
    transition: var(--ctf-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--ctf-space-2);
}

.btn-ctf-outline:hover {
    background: var(--ctf-bg-hover);
    border-color: var(--ctf-primary);
    color: var(--ctf-text);
    text-decoration: none;
}

.btn-ctf-danger {
    background: var(--ctf-danger);
    border: none;
    color: white;
    font-weight: 500;
    padding: var(--ctf-space-3) var(--ctf-space-6);
    border-radius: var(--ctf-radius);
    transition: var(--ctf-transition);
    text-decoration: none;
}

.btn-ctf-danger:hover {
    background: #dc2626;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Form Styles */
.form-control-ctf {
    background: var(--ctf-bg);
    border: 1px solid var(--ctf-border);
    color: var(--ctf-text);
    border-radius: var(--ctf-radius);
    padding: var(--ctf-space-3) var(--ctf-space-4);
    font-size: 1rem;
    transition: var(--ctf-transition);
    width: 100%;
}

.form-control-ctf:focus {
    outline: none;
    border-color: var(--ctf-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Badge Styles */
.badge-ctf {
    width: 100px;
    text-align: center;
    background: var(--ctf-primary);
    color: white;
    box-shadow: 0 0 10px green;
    font-weight: 500;
    padding: 10px;
    border-radius: var(--ctf-radius);
    font-size: 0.875rem;
    margin-left: -2px;
}

.ctf-card-modern>.card-body {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.card-body>.d-grid {
    background: #000 !important;
    width: 50%;
    transition: 0.2s;
    margin-top: auto;
}

.card-body>.d-grid:hover {
    width: 100%;
}

.card-body>p,
.card-body>div:nth-child(3) {
    padding-bottom: 20px;
    border-bottom: 1px solid green;
}

.col-6,
.mb-3>.d-flex>div {
    display: grid;
    gap: 10px;
}

.mb-3>.d-flex>i {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.py-5 > .mb-3{
    width: 100% !important;
    text-align: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.text-muted+.text-light {
    width: 160px;
    padding: 5px;
    border: 1px solid greenyellow;
    box-shadow: 0 0 10px green;
    background: #1e293b;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: end;
}

.timer-display-modern {
    display: flex;
    gap: 10px;
}

.timer-display-modern>span {
    width: 70px;
    display: flex;
    justify-content: center;
    padding: 5px 20px;
    background: #1e293b;
    border: 1px solid greenyellow;
    border-radius: 5px;
}

.timer-label-modern {
    padding-bottom: 10px;
}

.timer-labels {
    display: flex;
    gap: 10px;
}

.timer-labels>span {
    width: 70px;
    display: flex;
    justify-content: center;
}

.challenge-category-modern {
    border: 1px solid green;
    box-shadow: 0 0 10px green;
    border-radius: 10px;
    padding: 15px;
    transition: 0.2s;
}

.challenge-category-modern i {
    font-size: 35px;
    color: #10b981;
    padding-bottom: 10px;
    transition: 0.2s;
}

.challenge-category-modern:hover {
    transform: scale(1.1);
}

.challenge-category-modern:hover i {
    transform: scale(1.1);
    text-shadow: 0 0 10px green;
}

.challenge-header {
    display: grid;
    gap: 20px;
}

.challenge-difficulty {
    width: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.challenge-stat-modern{
    border-bottom: 1px solid green;
    margin-bottom: 10px;
    padding-bottom: 10px;
}
.challenge-card-modern {
    padding: 20px;
    border: 1px solid green;
    box-shadow: 0 0 10px green;
    border-radius: 10px;
    background: #000;
}
.leaderboard-modern {
    padding: 15px;
}

.leaderboard-item-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--ctf-bg-hover);
    padding: 12px 16px;
    margin-bottom: 10px;
    border-left: 4px solid var(--ctf-accent);
    border: 1px solid green;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.leaderboard-item-modern:hover {
    transform: scale(1.01);
    box-shadow: 0 0 10px var(--ctf-accent);
}

.participant-info {
    display: flex;
    align-items: center;
}

.participant-rank {
    font-size: 1.5em;
    font-weight: bold;
    margin-right: 10px;
    color: var(--ctf-accent);
}

.rank-number {
    text-shadow: 0 0 5px var(--ctf-accent);
}

.participant-name {
    font-size: 1.1em;
    margin: 0;
    color: var(--ctf-text);
}

.participant-stats {
    font-size: 0.9em;
    color: #aaa;
    margin: 0;
}

.participant-score {
    text-align: right;
}

.score-value {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--ctf-accent);
    text-shadow: 0 0 5px var(--ctf-accent);
}

.score-label {
    font-size: 0.8em;
    color: #999;
}

.rank-1 {
    border-left-color: gold;
}

.rank-2 {
    border-left-color: silver;
}

.rank-3 {
    border-left-color: #cd7f32;
    /* Bronze */
}



/* Alert Styles */
.alert-ctf {
    background: var(--ctf-bg-card);
    border: 1px solid var(--ctf-border);
    border-radius: var(--ctf-radius-lg);
    padding: var(--ctf-space-4) var(--ctf-space-6);
    margin-bottom: var(--ctf-space-4);
    position: relative;
}

.alert-ctf::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--ctf-primary);
    border-radius: var(--ctf-radius) 0 0 var(--ctf-radius);
}

.alert-ctf-success::before {
    background: var(--ctf-success);
}

.alert-ctf-danger::before {
    background: var(--ctf-danger);
}

.alert-ctf-warning::before {
    background: var(--ctf-warning);
}

.alert-ctf-info::before {
    background: var(--ctf-primary);
}

/* Table Styles */
.table-ctf {
    background: var(--ctf-bg-card);
    border-radius: var(--ctf-radius-lg);
    overflow: hidden;
    border: 1px solid var(--ctf-border);
    width: 100%;
}

.table-ctf th {
    background: var(--ctf-bg-hover);
    color: var(--ctf-text);
    font-weight: 600;
    border-bottom: 1px solid var(--ctf-border);
    padding: var(--ctf-space-4);
    text-align: left;
}

.table-ctf td {
    color: var(--ctf-text-secondary);
    border-bottom: 1px solid var(--ctf-border);
    padding: var(--ctf-space-4);
    vertical-align: middle;
}

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

/* Progress Bar */
.progress-ctf {
    background: var(--ctf-bg);
    border-radius: var(--ctf-radius);
    height: 8px;
    overflow: hidden;
}

.progress-ctf .progress-bar {
    background: var(--ctf-primary);
    border-radius: var(--ctf-radius);
    height: 100%;
    transition: width 0.3s ease;
}

/* Footer */
.ctf-footer {
    background: var(--ctf-bg-card);
    border-top: 1px solid var(--ctf-border);
    box-shadow: var(--ctf-shadow);
    padding: var(--ctf-space-8) 0;
    margin-top: auto;
}

.ctf-footer .footer-content {
    text-align: center;
    color: var(--ctf-text-secondary);
}

.ctf-footer .footer-links a {
    color: var(--ctf-text-secondary);
    text-decoration: none;
    margin: 0 var(--ctf-space-4);
    transition: var(--ctf-transition);
}

.ctf-footer .footer-links a:hover {
    color: var(--ctf-primary);
}

/* Status Badges */
.status-badge {
    padding: var(--ctf-space-2) var(--ctf-space-4);
    border-radius: var(--ctf-radius);
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: var(--ctf-space-2);
}

.status-active {
    background: var(--ctf-success);
    color: white;
}

.status-upcoming {
    background: var(--ctf-warning);
    color: white;
}

.status-ended {
    background: var(--ctf-secondary);
    color: white;
}

/* Stats Cards */
.stats-card {
    background: var(--ctf-bg-card);
    border: 1px solid var(--ctf-border);
    border-radius: var(--ctf-radius-lg);
    padding: var(--ctf-space-6);
    text-align: center;
    transition: var(--ctf-transition);
}

.stats-card:hover {
    border-color: var(--ctf-primary);
    transform: translateY(-2px);
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ctf-primary);
    margin-bottom: var(--ctf-space-2);
}

.stats-label {
    color: var(--ctf-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Loading Spinner */
.spinner-ctf {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ctf-border);
    border-top: 2px solid var(--ctf-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Text Utilities */
.text-primary {
    color: var(--ctf-primary) !important;
}

.text-success {
    color: var(--ctf-success) !important;
}

.text-warning {
    color: var(--ctf-warning) !important;
}

.text-danger {
    color: var(--ctf-danger) !important;
}

.text-muted {
    color: var(--ctf-text-muted) !important;
}

.text-light {
    color: var(--ctf-text) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .ctf-header .navbar-brand {
        font-size: 1.25rem;
    }

    .ctf-main {
        padding: var(--ctf-space-4) 0;
    }

    .ctf-card {
        margin-bottom: var(--ctf-space-4);
    }
}