/* =============================================
   OPPONENT PREPARATION — PREMIUM REDESIGN
   ============================================= */

/* ---- Type-accent CSS vars ---- */
:root {
    --op-type-control: #60a5fa;
    --op-type-escort: #ff9f1c;
    --op-type-hybrid: #2dd4bf;
    --op-type-push: #a78bfa;
    --op-type-flashpoint: #f87171;
}

/* ---- PAGE SHELL ---- */
.op-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- MAIN LAYOUT ---- */
.op-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1.5rem 120px;
    /* bottom pad for sticky bar */
    flex: 1;
}

@media (max-width: 992px) {
    .op-layout {
        grid-template-columns: 1fr;
    }
}

/* =====================
   SIDEBAR
   ===================== */
.op-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.op-sidebar-card {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.op-sidebar-card-grow {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.op-sidebar-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.6);
}

.op-sidebar-card-header i {
    color: #ff9f1c;
    font-size: 0.9rem;
}

.op-sidebar-card-body {
    padding: 1rem;
}

.op-badge {
    margin-left: auto;
    background: rgba(255, 159, 28, 0.2);
    color: #ff9f1c;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ---- Opponent Search ---- */
.op-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.op-search-icon {
    position: absolute;
    left: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
    pointer-events: none;
}

.op-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.6rem 2.5rem 0.6rem 2.25rem;
    color: #fff;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.op-search-input:focus {
    outline: none;
    border-color: rgba(255, 159, 28, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.1);
}

.op-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.op-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.op-search-clear:hover {
    color: #f87171;
}

/* ---- Saved Plans List ---- */
.op-saved-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    max-height: 420px;
}

.op-saved-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: default;
}

.op-saved-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #ff9f1c;
}

.op-saved-item-info {
    flex: 1;
    min-width: 0;
}

.op-saved-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.op-saved-item-meta {
    margin-top: 3px;
}

.op-map-chip {
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.op-saved-item-actions {
    display: flex;
    gap: 0.35rem;
}

.op-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.op-icon-btn-edit:hover {
    background: rgba(255, 159, 28, 0.2);
    border-color: rgba(255, 159, 28, 0.4);
    color: #ff9f1c;
}

.op-icon-btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.op-empty-plans {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.25);
    gap: 0.5rem;
}

.op-empty-plans i {
    font-size: 1.75rem;
}

.op-empty-plans p {
    font-size: 0.83rem;
    margin: 0;
}

/* =====================
   WELCOME STATE
   ===================== */
.op-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 2rem;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.op-welcome-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 159, 28, 0.2), rgba(46, 196, 182, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ff9f1c;
    margin-bottom: 0.5rem;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 159, 28, 0);
    }

    50% {
        box-shadow: 0 0 30px 6px rgba(255, 159, 28, 0.15);
    }
}

.op-welcome h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.op-welcome p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    max-width: 380px;
}

/* =====================
   MAP FILTER PILLS
   ===================== */
.op-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.op-filter-pill {
    display: flex;
    align-items: center;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.op-filter-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.op-filter-pill.active {
    background: rgba(255, 159, 28, 0.18);
    border-color: rgba(255, 159, 28, 0.45);
    color: #ff9f1c;
    box-shadow: 0 0 12px rgba(255, 159, 28, 0.15);
}

/* =====================
   MAP CARD GRID
   ===================== */
.op-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .op-map-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Individual Map Card ---- */
.op-map-card {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 4px solid var(--op-card-accent, rgba(255, 159, 28, 0.6));
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.op-map-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.op-map-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.op-map-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.op-map-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 999px;
}

.op-type-control {
    background: rgba(96, 165, 250, 0.18);
    color: var(--op-type-control);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.op-type-escort {
    background: rgba(255, 159, 28, 0.18);
    color: var(--op-type-escort);
    border: 1px solid rgba(255, 159, 28, 0.3);
}

.op-type-hybrid {
    background: rgba(45, 212, 191, 0.18);
    color: var(--op-type-hybrid);
    border: 1px solid rgba(45, 212, 191, 0.3);
}

.op-type-push {
    background: rgba(167, 139, 250, 0.18);
    color: var(--op-type-push);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.op-type-flashpoint {
    background: rgba(248, 113, 113, 0.18);
    color: var(--op-type-flashpoint);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ---- Ban Table ---- */
.op-ban-table {
    display: flex;
    gap: 0;
    flex: 1;
}

.op-ban-team-col {
    flex: 1;
    padding: 0.85rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.op-ban-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 0.5rem 0;
}

.op-ban-team-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.op-label-our {
    color: #4ade80;
}

.op-label-enemy {
    color: #f87171;
}

.op-ban-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.op-ban-num {
    width: 16px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
    flex-shrink: 0;
    text-align: center;
}

/* ---- Ban Slot ---- */
.op-ban-slot {
    flex: 1;
    min-height: 42px;
    border-radius: 9px;
    border: 1.5px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

.op-ban-slot:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.02);
}

.op-ban-slot-our {
    border-color: rgba(74, 222, 128, 0.2);
}

.op-ban-slot-our:hover {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(74, 222, 128, 0.06);
}

.op-ban-slot-our.has-heroes {
    border-style: solid;
    border-color: rgba(74, 222, 128, 0.4);
    background: rgba(74, 222, 128, 0.07);
}

.op-ban-slot-enemy {
    border-color: rgba(248, 113, 113, 0.2);
}

.op-ban-slot-enemy:hover {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(248, 113, 113, 0.06);
}

.op-ban-slot-enemy.has-heroes {
    border-style: solid;
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.07);
}

.op-ban-slot-placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.op-ban-slot-placeholder i {
    font-size: 0.65rem;
}

/* Filled slot */
.op-ban-slot-filled {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 4px 6px;
    width: 100%;
}

.op-ban-hero-img {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.op-ban-hero-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Backwards compat with old placeholder class inside filled areas */
.hero-selection-area-enhanced {
    position: relative;
}

/* =====================
   STICKY SAVE BAR
   ===================== */
.op-sticky-save {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 2rem;
    background: rgba(16, 17, 24, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    gap: 1rem;
}

.op-sticky-label {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
}

.op-sticky-label strong {
    color: #ff9f1c;
}

/* =====================
   HERO PICKER MODAL
   ===================== */
.op-hero-modal .modal-content {
    background: linear-gradient(135deg, rgba(22, 24, 32, 0.98), rgba(14, 16, 24, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
}

.op-hero-modal .modal-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 1.75rem;
}

.op-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.op-hero-modal .modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.op-selected-badge {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255, 159, 28, 0.2);
    color: #ff9f1c;
    font-size: 0.75rem;
    font-weight: 700;
}

.op-modal-body {
    padding: 1.25rem 1.75rem;
}

.op-modal-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.op-modal-search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
}

.op-modal-search-wrap i {
    position: absolute;
    left: 11px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    pointer-events: none;
}

.op-modal-search {
    width: 100%;
    padding: 0.55rem 1rem 0.55rem 2.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 0.88rem;
    transition: border-color 0.2s;
}

.op-modal-search:focus {
    outline: none;
    border-color: rgba(255, 159, 28, 0.45);
}

.op-modal-search::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

/* Role filter pills */
.op-role-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.op-role-pill {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.op-role-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.op-role-pill.active {
    background: rgba(255, 159, 28, 0.18);
    border-color: rgba(255, 159, 28, 0.45);
    color: #ff9f1c;
}

/* Role section in hero grid */
.op-hero-picker-grid {
    overflow-y: auto;
    max-height: 60vh;
    padding-right: 4px;
}

.op-role-section {
    margin-bottom: 1.5rem;
}

.op-role-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid var(--role-color, #ff9f1c);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--role-color, #ff9f1c);
}

.op-role-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    padding: 0 7px;
    font-size: 0.72rem;
}

.op-role-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

/* Individual hero card */
.op-hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.4rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    gap: 0.35rem;
}

.op-hero-card:hover {
    background: rgba(255, 159, 28, 0.08);
    border-color: rgba(255, 159, 28, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.op-hero-card.selected {
    background: rgba(255, 159, 28, 0.18);
    border-color: rgba(255, 159, 28, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 159, 28, 0.25), 0 5px 15px rgba(0, 0, 0, 0.3);
}

.op-hero-card.selected .op-hero-name {
    color: #ff9f1c;
}

/* Keep backward-compat for existing .hero-select-card-enhanced in modal */
.hero-select-card-enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.4rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    gap: 0.35rem;
}

.hero-select-card-enhanced:hover {
    background: rgba(255, 159, 28, 0.08);
    border-color: rgba(255, 159, 28, 0.3);
    transform: translateY(-2px);
}

.hero-select-card-enhanced.selected {
    background: rgba(255, 159, 28, 0.18);
    border-color: rgba(255, 159, 28, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 159, 28, 0.25);
}

.op-hero-icon,
.hero-select-card-enhanced .hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.15s ease;
}

.op-hero-card.selected .op-hero-icon,
.hero-select-card-enhanced.selected .hero-icon {
    border-color: rgba(255, 159, 28, 0.7);
}

.op-hero-name,
.hero-select-card-enhanced .hero-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.2;
}

/* =====================
   SHARED BUTTON
   ===================== */
.op-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1.25rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff9f1c, #ffb347);
    color: #111;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.op-btn-primary:hover {
    background: linear-gradient(135deg, #ffb347, #ff9f1c);
    box-shadow: 0 6px 20px rgba(255, 159, 28, 0.35);
    transform: translateY(-1px);
}

/* =====================
   ANIMATIONS
   ===================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.op-map-card {
    animation: fadeInUp 0.3s ease both;
}

.op-saved-item {
    animation: fadeInUp 0.25s ease both;
}

/* =====================
   SCROLLBARS
   ===================== */
.op-saved-list::-webkit-scrollbar,
.op-hero-picker-grid::-webkit-scrollbar {
    width: 4px;
}

.op-saved-list::-webkit-scrollbar-thumb,
.op-hero-picker-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 992px) {
    .op-layout {
        padding: 1rem 1rem 110px;
    }

    .op-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .op-sidebar-card {
        flex: 1 1 260px;
    }

    .op-saved-list {
        max-height: 260px;
    }
}

@media (max-width: 576px) {
    .op-map-grid {
        grid-template-columns: 1fr;
    }

    .op-role-hero-grid {
        grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    }

    .op-sticky-save {
        padding: 0.75rem 1rem;
    }

    .op-hero-icon,
    .hero-select-card-enhanced .hero-icon {
        width: 42px;
        height: 42px;
    }
}