/* ============================================
   SHARED UTILITIES - Used across all pages
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================ */

:root {
    /* Background Colors */
    --bg-dark: #1a1a1a;
    --bg-card: #2c2c2c;
    --bg-card-secondary: #333;
    --bg-input: rgba(255, 255, 255, 0.1);
    --bg-input-focus: rgba(255, 255, 255, 0.15);
    --bg-hover: rgba(255, 255, 255, 0.1);
    --bg-hover-strong: rgba(255, 255, 255, 0.2);

    /* Text Colors */
    --text-primary: #e8e8e8;
    --text-secondary: #ddd;
    --text-light: #ecf0f1;
    --text-muted: #999;
    --text-white: #fff;

    /* Brand Colors */
    --primary-blue: #36A2EB;
    --primary-blue-light: #5BC0DE;
    --primary-purple: #667eea;
    --primary-purple-dark: #764ba2;
    --accent-gold: #ffd700;
    --accent-orange: #ff8c00;

    /* State Colors */
    --success-bg: rgba(46, 213, 115, 0.2);
    --success-border: rgba(46, 213, 115, 0.5);
    --success-text: #2ed573;
    --success-color: #4caf50;
    --error-bg: rgba(255, 71, 87, 0.2);
    --error-border: rgba(255, 71, 87, 0.5);
    --error-text: #ff4757;

    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-strong: rgba(255, 255, 255, 0.2);
    --border-color-stronger: rgba(255, 255, 255, 0.3);

    /* Spacing */
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;

    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.2s ease;

    /* Gradients */
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    --gradient-green: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    --gradient-red: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* ============================================
   SHARED ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(255, 69, 0, 0.8),
                    0 0 20px rgba(255, 140, 0, 0.6);
    }
    to {
        box-shadow: 0 0 15px rgba(255, 69, 0, 1),
                    0 0 25px rgba(255, 140, 0, 0.8);
    }
}

@keyframes glow-purple {
    from {
        box-shadow: 0 0 10px rgba(138, 43, 226, 0.8),
                    0 0 20px rgba(147, 51, 234, 0.6);
    }
    to {
        box-shadow: 0 0 15px rgba(138, 43, 226, 1),
                    0 0 25px rgba(147, 51, 234, 0.8);
    }
}

@keyframes border-flicker {
    0% { opacity: 0.8; }
    50% { opacity: 1.0; }
    100% { opacity: 0.8; }
}

/* ============================================
   SHARED FORM COMPONENTS
   ============================================ */

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

.form-group label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--border-radius-sm);
    color: var(--text-white);
    font-size: 16px;
    transition: var(--transition-base);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-purple);
    background-color: var(--bg-input-focus);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group select option {
    background-color: var(--bg-card);
    color: var(--text-white);
}

/* ============================================
   SHARED BUTTON COMPONENTS
   ============================================ */

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-submit {
    background: var(--gradient-purple);
    color: white;
    flex: 1;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    transform: none;
}

.btn-submit.loading {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-cancel {
    background-color: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color-strong);
    flex: 1;
}

.btn-cancel:hover {
    background-color: var(--bg-hover-strong);
}

.btn-secondary {
    padding: 10px 20px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color-strong);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 0.95rem;
}

.btn-secondary:hover {
    background-color: var(--bg-hover-strong);
}

.btn-create {
    padding: 10px 20px;
    background: var(--gradient-purple);
    border: none;
    color: white;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-remove {
    padding: 10px 20px;
    background: var(--gradient-red);
    border: none;
    color: white;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 0.95rem;
}

.btn-remove:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* ============================================
   SHARED MODAL COMPONENTS
   ============================================ */

.sidebet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebet-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.sidebet-modal-content {
    position: relative;
    background: var(--gradient-card);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--border-radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.sidebet-modal-header h2 {
    margin: 0;
    color: var(--text-white);
    font-size: 1.5rem;
}

.sidebet-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.sidebet-modal-close:hover {
    background-color: var(--bg-input);
    color: var(--text-white);
}

.sidebet-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.sidebet-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   SHARED MESSAGE COMPONENTS
   ============================================ */

.message {
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.message.success,
.message-success {
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.message.error,
.message-error {
    background-color: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

/* ============================================
   SHARED UTILITY CLASSES
   ============================================ */

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.form-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}
