/* CS2 KD Lobbies - Main Stylesheet */

:root {
    /* FACEIT Color Scheme */
    --primary-color: #FF5500;        /* FACEIT Orange */
    --secondary-color: #FF5500;      /* FACEIT Orange (used for consistency) */
    --success-color: #00D632;        /* FACEIT Green */
    --warning-color: #FFB800;        /* FACEIT Yellow */
    --danger-color: #e74c3c;         /* Red for errors */
    --dark-bg: #0f0f0f;              /* FACEIT Dark Background */
    --darker-bg: #1c1c1c;            /* FACEIT Secondary Background */
    --light-bg: #252525;             /* FACEIT Card Background */
    --text-color: #e8e8e8;           /* FACEIT Light Text */
    --text-muted: #999999;           /* FACEIT Muted Text */
    --border-color: #2e2e2e;         /* FACEIT Border Color */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background:
        /* Subtle diagonal pattern overlay */
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 85, 0, 0.02) 10px,
            rgba(255, 85, 0, 0.02) 20px
        ),
        /* Radial gradient for depth */
        radial-gradient(ellipse at top, rgba(255, 85, 0, 0.05) 0%, transparent 60%),
        /* Base gradient */
        linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    color: var(--text-color);
    min-height: 100vh;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #FF6A00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 85, 0, 0.5);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Landing Page */
.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.landing-header {
    text-align: center;
    padding: 40px 0;
}

.logo h1 {
    font-size: 48px;
    color: var(--primary-color);
    text-shadow: 0 2px 10px rgba(255, 107, 53, 0.5);
}

.tagline {
    font-size: 20px;
    color: var(--text-muted);
    margin-top: 10px;
}

.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--darker-bg) 100%);
    border-radius: 12px;
    margin: 40px 0;
}

.hero-content h2 {
    font-size: 42px;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.how-it-works, .prize-structure, .rules {
    margin: 60px 0;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.how-it-works h2, .prize-structure h2, .rules h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step {
    text-align: center;
    padding: 30px;
    background: var(--darker-bg);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.prizes {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.prize {
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    min-width: 150px;
}

.prize-gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
}

.prize-silver {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #1a1a2e;
}

.prize-bronze {
    background: linear-gradient(135deg, #cd7f32, #e89850);
    color: #1a1a2e;
}

.prize-place {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.prize-amount {
    font-size: 32px;
    font-weight: bold;
}

.prize-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
}

.rules-list {
    list-style: none;
    padding: 0;
}

.rules-list li {
    padding: 16px;
    margin: 10px 0;
    background: var(--darker-bg);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--dark-bg);
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
}

.close:hover {
    color: var(--text-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--darker-bg);
    color: var(--text-color);
    font-size: 16px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 14px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.error-message {
    color: var(--danger-color);
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    background: rgba(231, 76, 60, 0.1);
    display: none;
}

.error-message.active {
    display: block;
}

.success-message {
    color: var(--success-color);
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    background: rgba(46, 204, 113, 0.1);
    display: none;
}

.success-message.active {
    display: block;
}

.info-message {
    color: var(--success-color);
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    background: rgba(46, 204, 113, 0.1);
}

/* Dashboard */
.dashboard-container, .lobby-container {
    min-height: 100vh;
}

.dashboard-header {
    background: var(--darker-bg);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
}

.dashboard-header .logo h1 {
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.balance {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--light-bg);
    border-radius: 8px;
}

.balance-amount {
    font-size: 20px;
    font-weight: bold;
    color: var(--success-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--darker-bg);
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
}

.action-section {
    text-align: center;
    margin: 60px 0;
}

.recent-games h2 {
    margin-bottom: 20px;
}

.games-list {
    display: grid;
    gap: 20px;
}

.game-card {
    background: var(--darker-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.no-games {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* Lobby */
.lobby-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.lobby-status {
    text-align: center;
    margin-bottom: 40px;
}

.lobby-timer {
    font-size: 24px;
    font-weight: bold;
    color: var(--warning-color);
    margin-top: 10px;
}

.payment-panel,
.waiting-panel,
.game-instructions {
    background: var(--darker-bg);
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    border: 2px solid var(--border-color);
}

.payment-info {
    margin: 30px 0;
}

.payment-item {
    margin: 20px 0;
}

.payment-item label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.payment-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-value input {
    flex: 1;
    padding: 12px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
}

.highlight {
    color: var(--success-color);
    font-size: 24px;
    font-weight: bold;
}

.payment-note {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.waiting-panel {
    text-align: center;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.players-section {
    margin: 40px 0;
}

.players-section h3 {
    margin-bottom: 20px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.player-card {
    background: var(--darker-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.player-card.is-user {
    border-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.1);
}

.player-nickname {
    font-weight: bold;
    margin-bottom: 5px;
}

.player-status {
    font-size: 12px;
    color: var(--text-muted);
}

.results-panel {
    background: var(--darker-bg);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
    }

    .prizes {
        flex-direction: column;
        align-items: center;
    }

    .user-menu {
        flex-wrap: wrap;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 20px;
    }
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--text-color);
}

/* Toast Types */
.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-success .toast-icon {
    color: var(--success-color);
    background: rgba(46, 204, 113, 0.1);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-error .toast-icon {
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-warning .toast-icon {
    color: var(--warning-color);
    background: rgba(243, 156, 18, 0.1);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

.toast-info .toast-icon {
    color: var(--primary-color);
    background: rgba(255, 107, 53, 0.1);
}

.toast-loading {
    border-left: 4px solid var(--primary-color);
}

.toast-loading .toast-icon {
    color: var(--primary-color);
    background: rgba(255, 107, 53, 0.1);
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Custom Confirmation Dialog
   ============================================ */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-overlay.confirm-show {
    opacity: 1;
}

.confirm-dialog {
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-overlay.confirm-show .confirm-dialog {
    transform: scale(1);
}

.confirm-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.confirm-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
}

.confirm-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.confirm-close:hover {
    color: var(--text-color);
}

.confirm-body {
    padding: 24px;
}

.confirm-body p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: var(--text-color);
}

.confirm-body p:last-child {
    margin-bottom: 0;
}

.confirm-info-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin: 8px 0;
}

.confirm-info-label {
    color: var(--text-muted);
    font-size: 14px;
}

.confirm-info-value {
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
}

.confirm-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-footer .btn {
    min-width: 100px;
}

/* Mobile responsiveness for toasts */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
    
    .confirm-dialog {
        width: 95%;
        margin: 10px;
    }
}
