/* ER Fits Public Stylesheet - Sci-Fi Glassmorphism Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

.er-fits-public-container {
    --bg-primary: #080c14;
    --bg-card: rgba(13, 20, 35, 0.65);
    --bg-panel: rgba(17, 27, 48, 0.85);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(6, 182, 212, 0.3);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --color-cyan: #06b6d4;
    --color-cyan-rgb: 6, 182, 212;
    --color-purple: #a855f7;
    --color-purple-rgb: 168, 85, 247;
    --color-amber: #f59e0b;
    --color-amber-rgb: 245, 158, 11;

    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 30px;
    border-radius: 12px;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8), 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
    margin: 20px 0;
    max-width: 100%;
}

/* Background grid overlay */
.er-fits-public-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

.er-fits-public-container * {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Typography & Headers */
.er-fits-header {
    margin-bottom: 30px;
}

.er-fits-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--color-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.er-fits-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
    font-weight: 300;
}

/* Filter/Search Bar */
.er-fits-filter-bar {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px 14px;
    margin-bottom: 30px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.er-fits-filter-bar:focus-within {
    border-color: rgba(var(--color-cyan-rgb), 0.5);
    box-shadow: 0 0 15px rgba(var(--color-cyan-rgb), 0.15);
}

.er-fits-search-icon {
    color: var(--text-secondary);
    margin-right: 10px;
    font-size: 20px;
    height: 20px;
    width: 20px;
}

#er-fits-search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    padding: 10px 0;
    width: 100%;
    outline: none;
    box-shadow: none;
}

#er-fits-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Grid & Cards */
.er-fits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.er-fits-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.er-fits-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.er-fits-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(var(--color-cyan-rgb), 0.1);
}

.er-fits-card:hover .er-fits-card-glow {
    opacity: 1;
}

.er-fits-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.er-fits-card-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.2;
}

.er-fits-badge {
    background: rgba(var(--color-cyan-rgb), 0.1);
    color: var(--color-cyan);
    border: 1px solid rgba(var(--color-cyan-rgb), 0.25);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.er-fits-card-body {
    flex-grow: 1;
    margin-bottom: 20px;
}

.er-fits-ship-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.er-fits-ship-meta .dashicons {
    font-size: 16px;
    height: 16px;
    width: 16px;
    color: var(--color-purple);
}

.er-fits-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 300;
}

.er-fits-card-footer {
    margin-top: auto;
}

/* Custom Styled Button */
.er-fits-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(var(--color-cyan-rgb), 0.1) 0%, rgba(var(--color-purple-rgb), 0.1) 100%);
    border: 1px solid rgba(var(--color-cyan-rgb), 0.3);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.er-fits-btn-primary:hover {
    background: linear-gradient(135deg, rgba(var(--color-cyan-rgb), 0.25) 0%, rgba(var(--color-purple-rgb), 0.25) 100%);
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px rgba(var(--color-cyan-rgb), 0.25);
    color: #fff;
}

.er-fits-btn-primary .dashicons {
    font-size: 16px;
    height: 16px;
    width: 16px;
    transition: transform 0.2s ease;
}

.er-fits-btn-primary:hover .dashicons {
    transform: translateX(4px);
}

/* Detail Page Layout */
.er-fits-back-nav {
    margin-bottom: 25px;
}

.er-fits-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.er-fits-btn-back:hover {
    color: var(--color-cyan);
}

.er-fits-btn-back .dashicons {
    font-size: 16px;
    height: 16px;
    width: 16px;
    transition: transform 0.2s ease;
}

.er-fits-btn-back:hover .dashicons {
    transform: translateX(-3px);
}

.er-fits-detail-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 25px;
}

.er-fits-detail-badge {
    background: rgba(var(--color-amber-rgb), 0.1);
    color: var(--color-amber);
    border: 1px solid rgba(var(--color-amber-rgb), 0.25);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 12px;
}

.er-fits-detail-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #fff;
    letter-spacing: -0.5px;
}

.er-fits-detail-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    font-weight: 300;
}

.er-fits-detail-description p {
    margin-bottom: 1em;
}

.er-fits-detail-description p:last-child {
    margin-bottom: 0;
}

/* Tabs Navigation */
.er-fits-tabs-container {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1px;
}

.er-fits-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 10px;
}

.er-fits-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none;
}

.er-fits-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(var(--color-cyan-rgb), 0.3);
    color: var(--text-primary);
}

.er-fits-tab-btn.active {
    background: rgba(var(--color-cyan-rgb), 0.08);
    border-color: var(--color-cyan);
    color: #fff;
    box-shadow: 0 0 15px rgba(var(--color-cyan-rgb), 0.15);
}

.er-fits-tab-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease;
}

.er-fits-tab-btn.active .er-fits-tab-icon {
    border-color: var(--color-cyan);
    box-shadow: 0 0 8px rgba(var(--color-cyan-rgb), 0.5);
}

.er-fits-tab-text {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Tabs Content Pane */
.er-fits-tab-content {
    display: none;
    animation: erFitsFadeIn 0.4s ease;
}

.er-fits-tab-content.active {
    display: block;
}

@keyframes erFitsFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Fit Grid: 2 Column Layout */
.er-fits-fit-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 800px) {
    .er-fits-fit-grid {
        grid-template-columns: 1.2fr 1fr;
    }
}

/* Left Panel: Fitting Grid Layout Wrapper */
.er-fits-fit-visual-panel {
    background: rgba(4, 7, 15, 0.95);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 10px;
    padding: 24px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.95), 0 0 20px rgba(6, 182, 212, 0.05);
}

.er-fits-visual-panel-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(25px) brightness(0.25) opacity(0.35);
    pointer-events: none;
    z-index: 0;
}

.er-fits-grid-layout {
    display: grid;
    grid-template-columns: auto 256px auto;
    grid-template-rows: auto 256px auto;
    align-items: center;
    justify-items: center;
    gap: 8px;
    background: rgba(5, 8, 16, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Central Ship Render */
.er-fits-central-render {
    grid-area: 2 / 2;
    width: 256px;
    height: 256px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(var(--color-cyan-rgb), 0.1);
    background: #000;
}

.er-fits-ship-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* High Slots: top row, column 2 */
.er-fits-high-slots {
    grid-area: 1 / 2;
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Medium Slots: right col, row 2 */
.er-fits-med-slots {
    grid-area: 2 / 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* Low Slots: bottom row, col 2 */
.er-fits-low-slots {
    grid-area: 3 / 2;
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Rig Slots: left col, row 2 */
.er-fits-rig-slots {
    grid-area: 2 / 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* Slot Items styling */
.er-fits-slot-item {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.er-fits-slot-item:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(var(--color-cyan-rgb), 0.5);
}

.er-fits-slot-icon {
    width: 32px;
    height: 32px;
    border-radius: 2px;
    display: block;
}

/* Unused/Empty slot styles */
.er-fits-slot-item.is-unused {
    border: 1px dashed rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.01);
    cursor: default;
}

.er-fits-slot-item.is-unused:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.er-fits-slot-item.is-empty {
    border: 1px dashed rgba(var(--color-cyan-rgb), 0.2);
    background: rgba(var(--color-cyan-rgb), 0.02);
}

.er-fits-slot-item.is-empty:hover {
    border-color: rgba(var(--color-cyan-rgb), 0.5);
    box-shadow: 0 0 8px rgba(var(--color-cyan-rgb), 0.2);
}

/* Tooltip styles */
.er-fits-slot-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    opacity: 0;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
}

.er-fits-slot-item[data-tooltip]:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* Mobile responsive scaling */
@media (max-width: 500px) {
    .er-fits-grid-layout {
        transform: scale(0.8);
    }
}

/* Right Panel: Fit Text Panel */
.er-fits-fit-text-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.er-fits-panel-header {
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.er-fits-panel-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.er-fits-btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(var(--color-cyan-rgb), 0.1);
    border: 1px solid rgba(var(--color-cyan-rgb), 0.3);
    color: var(--color-cyan);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    outline: none;
}

.er-fits-btn-copy:hover {
    background: rgba(var(--color-cyan-rgb), 0.2);
    border-color: var(--color-cyan);
    color: #fff;
    box-shadow: 0 0 8px rgba(var(--color-cyan-rgb), 0.2);
}

.er-fits-btn-copy.copied {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}

.er-fits-btn-copy .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.er-fits-code-wrapper {
    padding: 20px;
    flex-grow: 1;
    background: #04070e;
}

.er-fits-fit-textarea {
    width: 100%;
    height: auto;
    background: transparent;
    border: none;
    color: #38bdf8;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* Scrollbar customizations */
.er-fits-fit-textarea::-webkit-scrollbar,
.er-fits-tabs-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.er-fits-fit-textarea::-webkit-scrollbar-track,
.er-fits-tabs-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.er-fits-fit-textarea::-webkit-scrollbar-thumb,
.er-fits-tabs-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.er-fits-fit-textarea::-webkit-scrollbar-thumb:hover,
.er-fits-tabs-container::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--color-cyan-rgb), 0.4);
}

/* Empty Doctrine States */
.er-fits-empty-card,
.er-fits-error-msg {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
}