/* Custom Styles for DevOps Gauntlet v4.0 - Modern UI */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #0f0f23;
    --surface-color: #1a1a2e;
    --surface-hover: #232341;
    --border-color: #2d2d44;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-purple: #a78bfa;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

body {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.dashboard {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.metric-card {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.recent-activity h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.repo-list {
    display: grid;
    gap: 1.5rem;
}

.repo-card {
    background: rgba(26, 26, 46, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.repo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.repo-card:hover {
    border-color: var(--primary-color);
    transform: translateX(8px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}

.repo-card:hover::before {
    opacity: 1;
}

.recent-activity {
    margin-top: 3rem;
}

.recent-activity h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.repo-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-private {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.repo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.repo-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-color);
}

.repo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
}

.repo-link:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateX(4px);
    color: var(--accent-purple);
}

.alert {
    padding: 1.5rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.repo-updated {
    margin-left: auto;
}

.repo-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.repo-link:hover {
    color: #58a6ff;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-danger {
    background-color: rgba(207, 34, 46, 0.15);
    border: 1px solid var(--danger-color);
    color: #ff7b72;
}

.alert-heading {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.text-muted {
    color: var(--text-secondary);
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Tab Navigation Styles */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    list-style: none;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-bottom: -2px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    border-bottom-color: transparent;
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
    border-bottom-color: var(--background-color);
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.nav-link i {
    font-size: 1.125rem;
}

/* Tab Panes */
.tab-content {
    animation: fadeIn 0.4s ease-in-out;
}

.tab-pane {
    display: block;
}

.tab-pane.d-none {
    display: none !important;
}

.tab-pane.active {
    display: block;
}

.tab-pane.show {
    opacity: 1;
}

/* Page Header Styles */
.page-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.page-header .lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Leaderboards Page Specific */
.leaderboards-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-in-out;
}

/* Responsive Tab Design */
@media (max-width: 768px) {
    .nav-tabs {
        flex-direction: column;
        border-bottom: none;
        gap: 0.25rem;
    }

    .nav-link {
        border-radius: 12px;
        border: 2px solid var(--border-color);
        margin-bottom: 0;
    }

    .nav-link.active::after {
        display: none;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .lead {
        font-size: 1rem;
    }
}