/* Dark Theme - VS Code Style */
body {
    background-color: #1e1e1e !important;
    color: #d4d4d4 !important;
}

.bg-light {
    background-color: #252526 !important;
}

/* Cards */
.card {
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    color: #d4d4d4;
}

.card-header {
    background-color: #252526 !important;
    border-bottom: 1px solid #3e3e42;
    color: #d4d4d4;
}

.card-body {
    background-color: #2d2d30;
    color: #d4d4d4;
}

/* List Groups */
.list-group-item {
    background-color: #252526;
    border-color: #3e3e42;
    color: #d4d4d4;
}

.list-group-item:hover {
    background-color: #2d2d30;
}

/* Keep current/active list-group-item appearance when hovered */
.list-group-item.active, .list-group-item.active:hover {
    background-color: #0d6efd !important;
    color: #ffffff !important;
    border-color: #0d6efd !important;
}

/* Forms */
.form-control {
    background-color: #3c3c3c;
    border-color: #3e3e42;
    color: #d4d4d4;
}

.form-control:focus {
    background-color: #3c3c3c;
    border-color: #667eea;
    color: #d4d4d4;
}

.form-control::placeholder {
    color: #858585;
}

/* Tables */
.table {
    color: #d4d4d4;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #252526;
}

.table-hover > tbody > tr:hover > * {
    background-color: #2d2d30;
}

/* Alerts */
.alert-warning {
    background-color: #4a3b00;
    border-color: #6b5500;
    color: #fde047;
}

.alert-success {
    background-color: #0f4d2c;
    border-color: #166534;
    color: #86efac;
}

.alert-danger {
    background-color: #5c0f0f;
    border-color: #7f1d1d;
    color: #fca5a5;
}

.alert-info {
    background-color: #2d2d30;
    border-color: #3e3e42;
    color: #7dd3fc;
}

/* Text colors */
.text-muted {
    color: #858585 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #d4d4d4;
}

/* Lobby specific styles */
.lobby-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.card-custom {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    border-radius: 0.5rem;
    background-color: #2d2d30;
}

.participant-item {
    transition: all 0.2s;
    background-color: #252526;
    color: #d4d4d4;
}

.participant-item:hover {
    background-color: #2d2d30;
}

.route-step {
    border-left: 3px solid #667eea;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.split-badge {
    background-color: #4a3b00;
    border: 1px solid #ffc107;
    color: #fde047;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* Badges */
.badge.bg-secondary {
    background-color: #3e3e42 !important;
}

.badge.bg-light {
    background-color: #3e3e42 !important;
    color: #d4d4d4 !important;
}

/* Modals */
.modal-content {
    background-color: #2d2d30;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
}

.modal-header {
    border-bottom-color: #3e3e42;
}

.modal-footer {
    border-top-color: #3e3e42;
}

/* Pagination */
.pagination .page-link {
    background-color: #252526;
    border-color: #3e3e42;
    color: #d4d4d4;
}

.pagination .page-link:hover {
    background-color: #2d2d30;
    border-color: #667eea;
    color: #d4d4d4;
}

.pagination .page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
}

/* Spel.php specific */
.task-card {
    background-color: #2d2d30 !important;
    border-color: #3e3e42 !important;
}

.bg-white {
    background-color: #252526 !important;
}

/* Progress bars */
.progress {
    background-color: #252526;
}

/* Borders */
.border {
    border-color: #3e3e42 !important;
}

/* Input groups */
.input-group-text {
    background-color: #252526;
    border-color: #3e3e42;
    color: #d4d4d4;
}

/* Tile / board styles for spel.php */
.tile {
    color: #d4d4d4;
    background-color: #252526;
    border: 1px solid #3e3e42;
    padding: 0.5rem;
    border-radius: 3px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Ensure tiles in the board overview fill their bootstrap column and stack neatly */
.card .card-body .row .tile {
    width: 100% !important;
    height: auto !important;
    flex: 1 1 auto !important;
    aspect-ratio: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.75rem !important;
    margin: 0 !important;
    border-radius: 4px !important;
    min-height: 140px !important;
}

/* Keep internal layout tidy: wrap long text and badges */
.card .card-body .row .tile .fw-bold,
.card .card-body .row .tile .small {
    word-break: break-word;
    white-space: normal;
}

/* For split options (two-column), keep them full-width within their col-6 */
.card .card-body .row .col-6 .tile {
    width: 100% !important;
}

/* CLEANUP: Drastically reduce padding and spacing in tiles */
.card .card-body .row .tile .fw-bold {
    font-size: 0.85rem !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.card .card-body .row .tile .badge {
    font-size: 0.70rem !important;
    padding: 0.25rem 0.4rem !important;
    margin-right: 0.25rem !important;
}

.card .card-body .row .tile .small {
    font-size: 0.75rem !important;
    margin: 0.3rem 0 0 0 !important;
    line-height: 1.3 !important;
}

/* Tighten row gaps and ensure proper flexbox behavior */
.card .card-body .row {
    gap: 0.5rem !important;
    display: flex !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
}

.card .card-body .row .col-12,
.card .card-body .row .col-6 {
    padding: 0 !important;
}
.tile.completed {
    background-color: #2d2d30;
}
.tile.current {
    background-color: #0f3460;
    color: #ffffff;
}
.card .card-body .row .split-header.tile {
    background-color: #252526;
    border: 1px solid #3e3e42;
    min-height: 48px !important;
    padding: 0.35rem 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.card .card-body .row .split-header.tile.current {
    background-color: #0f3460;
    color: #ffffff;
    min-height: 48px !important;
    padding: 0.35rem 0.5rem !important;
}

.card .card-body .row .split-header.tile.completed {
    background-color: #2d2d30;
    min-height: 48px !important;
    padding: 0.35rem 0.5rem !important;
}
.split-option.tile {
    background-color: #252526;
    border: 1px solid #3e3e42 !important;
    padding: 0.4rem !important;
    margin: 0 !important;
    min-height: 90px !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}
.split-option.tile.skipped {
    background-color: #2d2d30;
}

/* Ensure split containers have proper flex layout within their own row */
.card .card-body .row .col-12 .row .col-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
}

/* Remove extra margins/padding from split option containers */
.card .card-body .row .col-12 .row {
    margin: 0 !important;
    gap: 0.5rem !important;
}

/* Specific tile skin rules (match css_class values in OBG_tile_skins) */
.tile-grass {
    background-color: #3aa34a;
}
.tile-wilderness {
    background-color: #2f3b1f;
}
.tile-lava {
    /* Use uploaded image for lava tiles (fallback color kept) */
    background-color: #ff6b3d;
    /* Try multiple relative paths as fallbacks so image loads regardless of CSS/docroot location */
    background-image: url('assets/tile-test.jpg'), url('../assets/tile-test.jpg'), url('/osrsboard/assets/tile-test.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #fff;
}
.tile-water {
    background-color: #4aa8ff;
}
.tile .avatar-name {
    text-align: center;
    display: block;
}

/* Caption inside avatar at bottom */
.tile-avatar {
    position: relative;
}
.tile-avatar .avatar-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    padding: 4px 6px;
    font-size: 0.75rem;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.tile-sand {
    background-color: #f0d59b;
    color: #2b2b2b;
}
.tile-custom {
    background-color: #2d2d30;
}

/* Small visual tweak so icon/badge contrasts on bright tiles */
.tile-grass .badge, .tile-wilderness .badge, .tile-water .badge, .tile-sand .badge {
    color: #ffffff;
}

/* Preview box used in bord_samenstellen.php */
.tile-preview {
    width: 40px;
    height: 40px;
    display: inline-block;
    border-radius: 6px;
    margin-left: 6px;
    border: 1px solid #3e3e42;
    vertical-align: middle;
    background-size: cover;
}
.tile-preview.small {
    width: 28px;
    height: 28px;
}

/* Avatar for boss tiles */
.tile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.15);
    background-color: #222;
}
.tile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center; /* align image at top so head is visible */
    display: block;
    padding: 4px; /* small inset so image doesn't touch edges */
    box-sizing: border-box;
    background-color: transparent;
}
.avatar-name {
    color: #d4d4d4;
}

/* Position badge top-left inside tile */
.tile.position-relative {
    padding-top: 1rem;
}
.tile-position-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    font-size: 0.75rem;
    padding: 0.25rem 0.45rem;
}

/* Make avatar and name visually tighter and centered */
.tile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 8px;
}
.tile .avatar-name {
    text-align: center;
    display: block;
}

/* Avatar stack placed under badge - keeps name centered under image */
.avatar-stack {
    width: 80px;
    margin-left: 8px; /* align under badge */
    text-align: center;
}

/* Tighter text for split header tiles so they appear smaller in the board overview */
.card .card-body .row .split-header.tile .fw-bold {
    font-size: 0.78rem !important;
    margin: 0 !important;
    line-height: 1 !important;
}
.card .card-body .row .split-header.tile .small {
    font-size: 0.65rem !important;
    margin: 0 !important;
}
.card .card-body .row .split-header.tile .badge {
    font-size: 0.62rem !important;
    padding: 0.18rem 0.32rem !important;
}

