/**
 * Main Stylesheet
 * Uses CSS variables from whitelabel-config.js
 */

/* ===== CSS VARIABLES ===== */
:root {
    /* Colors are injected from JavaScript config */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-primaryLight);
}

/* ===== LAYOUT ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: var(--color-backgroundLight);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.nav-link:hover {
    background: var(--color-backgroundLighter);
}

.nav-link.active {
    background: var(--color-primary);
    color: white;
}

.user-balance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-backgroundLighter);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.view {
    animation: fadeIn 0.3s ease;
}

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

/* ===== HERO SECTION ===== */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

/* ===== CARDS ===== */
.card {
    background: var(--color-cardBackground);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.card-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-body {
    margin-bottom: 1rem;
}

/* ===== FORMS ===== */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-textSecondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-backgroundLighter);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.error-message {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--color-primaryDark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--color-secondary);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-secondaryDark);
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

/* ===== CONTESTS ===== */
.contests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.contest-card {
    background: var(--color-cardBackground);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

.contest-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.contest-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.contest-header h3 {
    font-size: 1.25rem;
    margin: 0;
}

.sport-badge {
    background: var(--color-secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.contest-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item .label {
    font-size: 0.875rem;
    color: var(--color-textSecondary);
    margin-bottom: 0.25rem;
}

.detail-item .value {
    font-size: 1.125rem;
    font-weight: 600;
}

.detail-item .value.prize {
    color: var(--color-accent);
}

.contest-progress {
    margin: 1rem 0;
}

.progress-bar {
    height: 8px;
    background: var(--color-backgroundLighter);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: width 0.3s ease;
}

/* ===== DRAFT SCREEN ===== */
.draft-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.players-list {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.player-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-cardBackground);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.75rem;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.player-card:hover {
    border-color: var(--color-primary);
    transform: translateX(4px);
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.player-position {
    color: var(--color-textSecondary);
    font-size: 0.875rem;
}

.player-salary {
    color: var(--color-accent);
    font-weight: 600;
    margin-top: 0.25rem;
}

.lineup-sidebar {
    background: var(--color-cardBackground);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
    height: fit-content;
    box-shadow: var(--shadow);
}

.lineup-sidebar h3 {
    margin-bottom: 1rem;
}

.salary-display {
    background: var(--color-backgroundLighter);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
}

.salary-display .label {
    color: var(--color-textSecondary);
    font-size: 0.875rem;
}

.salary-display .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-success);
}

.salary-display .amount.over-cap {
    color: var(--color-error);
}

.selected-players {
    margin-bottom: 1rem;
}

.selected-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--color-backgroundLighter);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.selected-player button {
    background: var(--color-error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1rem;
}

/* ===== BADGES & STATUS ===== */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

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

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

.status-closed {
    background: var(--color-textMuted);
    color: white;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-textSecondary);
}

.empty-state i {
    color: var(--color-textMuted);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* ===== LOADING ===== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 100px;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: var(--color-success);
    color: white;
}

.notification-error {
    background: var(--color-error);
    color: white;
}

.notification-info {
    background: var(--color-info);
    color: white;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--color-backgroundLight);
    border-top: 1px solid var(--color-border);
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--color-textSecondary);
    font-size: 0.875rem;
}

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

.footer-copyright {
    color: var(--color-textMuted);
    font-size: 0.875rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }

    .main-content {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .contests-grid {
        grid-template-columns: 1fr;
    }

    .draft-container {
        grid-template-columns: 1fr;
    }

    .lineup-sidebar {
        position: static;
    }
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

