/* ==========================================================================
   Matchday Roster Builder - Complete Stylesheet
   ========================================================================== */

/* Main Container Reset */
#mrb-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    color: #0f172a;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

#mrb-container * {
    box-sizing: border-box;
}

/* Header Section */
.mrb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
}

.mrb-title {
    margin: 0 !important;
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.mrb-subtitle {
    margin: 4px 0 0 0 !important;
    color: #64748b;
    font-size: 0.9rem;
}

.mrb-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Cards & Layout Panels */
.mrb-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.mrb-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.mrb-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.mrb-meta-card label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 5px;
}

.mrb-input, .mrb-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #fff;
}

.mrb-color-picker {
    width: 100%;
    height: 38px;
    padding: 2px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
}

/* Side-by-Side Builder Grid */
.mrb-builder-grid {
    display: grid !important;
    grid-template-columns: 300px 1fr !important;
    gap: 20px !important;
    align-items: start !important;
}

@media (max-width: 900px) {
    .mrb-builder-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Squad Panel (Left Column) */
.mrb-squad-panel {
    position: sticky !important;
    top: 20px !important;
    max-height: 75vh !important;
    display: flex !important;
    flex-direction: column !important;
}

.mrb-panel-header h3 {
    margin: 0 0 10px 0 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
}

.mrb-drag-container {
    overflow-y: auto !important;
    max-height: 60vh !important;
    flex-grow: 1 !important;
    padding-right: 5px !important;
}

/* Player Cards */
.mrb-player-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #2563eb;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.mrb-player-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mrb-player-card:active {
    cursor: grabbing;
    transform: scale(0.98);
}

/* Target Slot Boxes (Right Column) */
.mrb-section-title {
    margin: 0 0 12px 0 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #1e3a8a !important;
}

.mrb-slot-box {
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 4px 8px;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.mrb-slot-number {
    font-weight: 700;
    width: 28px;
    height: 28px;
    background: #1e293b;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.mrb-divider {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

/* Action Buttons */
.mrb-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mrb-btn-primary {
    background: #2563eb;
    color: #ffffff !important;
}

.mrb-btn-primary:hover {
    background: #1d4ed8;
}

.mrb-btn-info {
    background: #0284c7;
    color: #ffffff !important;
}

.mrb-btn-info:hover {
    background: #0369a1;
}

.mrb-btn-success {
    background: #16a34a;
    color: #ffffff !important;
}

.mrb-btn-success:hover {
    background: #15803d;
}

/* Text Export Modal Overlay */
.mrb-modal {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mrb-modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.mrb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.mrb-modal-header h3 {
    margin: 0 !important;
    font-size: 1.25rem !important;
    color: #0f172a !important;
}

.mrb-modal-close {
    font-size: 1.5rem;
    font-weight: bold;
    color: #64748b;
    cursor: pointer;
}

.mrb-modal-close:hover {
    color: #0f172a;
}

.mrb-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    background-color: #f8fafc;
    color: #334155;
    margin: 15px 0;
}

.mrb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}