/* ============================================
   PAGE-SPECIFIC STYLES: ENCHANTING SIMULATOR
   ============================================ */

/* -- Page-calculator layout (body padding + container) -- */
.page-calculator .container {
    max-width: 1200px;
    margin: 0 auto;
    background: #1a1a1f;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.page-calculator h1 {
    color: var(--warning);
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 10px;
}

.page-calculator h2 {
    color: var(--accent);
    margin-top: 40px;
    border-left: 5px solid var(--accent);
    padding-left: 15px;
}

.page-calculator .subtitle {
    text-align: center;
    color: #999;
    font-size: 0.9em;
    margin-bottom: 30px;
}

.tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
    font-weight: bold;
    background: rgba(30, 30, 40, 0.6);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.tab-btn.rune-odian-tab {
    padding: 12px 12px;
}

.tab-icon {
    width: 26px;
    height: 26px;
    display: block;
    filter: brightness(0.9);
    transition: filter 0.3s;
    pointer-events: none;
}

.tab-label-icon {
    width: 26px;
    height: 26px;
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

.tab-btn.rune-odian-tab:hover .tab-icon {
    filter: brightness(1.1);
}

.tab-btn.rune-odian-tab.active .tab-icon {
    filter: brightness(1.3);
}

.tab-content {
    display: none;
}

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

.simulator-panel {
    background: rgba(30, 30, 40, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95em;
}

.setting-group select,
.setting-group input {
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.setting-group select:focus,
.setting-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(181, 101, 245, 0.3);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.sim-button {
    flex: 1;
    padding: 12px 24px;
    background: rgba(181, 101, 245, 0.2);
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
    border-radius: 8px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: top;
}

.sim-button:hover {
    background: var(--accent-purple);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 0 15px rgba(181, 101, 245, 0.5);
}

.sim-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.output-container {
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.8;
}

.output-line {
    color: var(--text-primary);
    margin-bottom: 8px;
    padding: 6px 8px;
    border-left: 3px solid transparent;
}

.output-line.success {
    color: var(--success);
    border-left-color: var(--success);
}

.output-line.fail {
    color: #ffaa00;
    border-left-color: #ffaa00;
}

.output-line.destroy {
    color: var(--error);
    border-left-color: var(--error);
}

.output-line.summary {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: bold;
    margin-top: 15px;
    padding: 10px 8px;
    background: rgba(181, 101, 245, 0.1);
    border-radius: 4px;
}

.output-line.header {
    color: var(--accent-purple);
    font-weight: bold;
    border-left-color: var(--accent-purple);
}

.simulator-info {
    background: rgba(181, 101, 245, 0.1);
    border-left: 4px solid var(--accent-purple);
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.6;
}

.clear-button {
    padding: 8px 16px;
    background: rgba(100, 100, 120, 0.4);
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.clear-button:hover {
    background: rgba(200, 50, 50, 0.3);
    border-color: var(--error);
    color: var(--error);
}

.items-display {
    background: rgba(20, 20, 30, 0.5);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.items-display h3 {
    color: var(--accent-purple);
    margin: 0 0 15px 0;
    font-size: 1.05em;
}

.items-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0 10px 0;
}

.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(30, 30, 40, 0.6);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: 70px;
}

.item-card:hover {
    background: rgba(181, 101, 245, 0.15);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.item-card img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: crisp-edges;
}

.odian-frame {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://aioncodex.com/images/icon_frame_2.png') no-repeat center;
    background-size: contain;
}

.odian-frame img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: crisp-edges;
}

.item-card span {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
    line-height: 1.2;
}

.stone-button {
    cursor: pointer;
    position: relative;
}

.stone-button.active {
    background: rgba(181, 101, 245, 0.3);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(181, 101, 245, 0.5);
}
/* Ultimate Gear Chance Display */
.ultimate-chance-box {
    background: rgba(30, 30, 40, 0.9);
    border: 2px solid var(--border-secondary);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}

.chance-header {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--accent-purple);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-transition {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.level-transition .arrow {
    color: var(--accent-purple);
    font-weight: bold;
}

.chance-percentage {
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chance-percentage span {
    color: var(--warning);
    font-weight: bold;
    font-size: 1.3em;
}

.critical-info {
    font-size: 0.95em;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Ultimate Attempts Counter */
.ultimate-gear-attempts {
    font-size: 0.95em;
    color: var(--text-muted);
    margin: 15px 0;
    font-family: 'Courier New', monospace;
}

.ultimate-gear-attempts span {
    color: var(--accent-purple);
    font-weight: bold;
    font-size: 1.1em;
}

/* Enchant Loading Bar Animation */
.enchant-loading-bar {
    width: 100%;
    height: 3px;
    background: rgba(181, 101, 245, 0.1);
    border-radius: 2px;
    margin: 8px 0;
    overflow: hidden;
}

.enchant-loading-bar.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--primary-blue));
    border-radius: 2px;
    animation: enchantLoadingAnimation 0.3s ease-in-out forwards;
}

@keyframes enchantLoadingAnimation {
    from {
        width: 0%;
        box-shadow: 0 0 10px rgba(181, 101, 245, 0.8);
    }
    to {
        width: 100%;
        box-shadow: 0 0 15px rgba(181, 101, 245, 0.3);
    }
}

/* Info Button & Rates Modal */
.info-button {
    background: rgba(77, 184, 255, 0.15);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-left: 10px;
}

.info-button:hover {
    background: rgba(77, 184, 255, 0.25);
    box-shadow: 0 0 12px rgba(77, 184, 255, 0.4);
    transform: translateY(-1px);
}

.rates-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 20px;
}

.rates-modal-content {
    background: var(--bg-panel-solid);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(181, 101, 245, 0.3);
    position: relative;
}

.rates-modal-content h3 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.2em;
    border-bottom: 1px solid rgba(181, 101, 245, 0.3);
    padding-bottom: 10px;
}

.rates-modal-content table {
    border-collapse: collapse;
    margin-bottom: 15px;
}

.rates-modal-content table tr {
    border-bottom: 1px solid rgba(181, 101, 245, 0.2);
}

.rates-modal-content table tr:last-child {
    border-bottom: none;
}

.rates-modal-content table td {
    padding: 8px 12px;
    color: var(--text-primary);
}

.rates-modal-content table td:first-child {
    font-weight: 600;
    color: var(--accent);
    width: 20%;
}

.close {
    color: var(--text-muted);
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .page-calculator .container {
        padding: 15px;
        max-width: 100%;
    }
    .page-calculator h1 {
        font-size: 1.5em;
        padding-bottom: 15px;
        margin-bottom: 10px;
    }
    .page-calculator h2 {
        font-size: 1.3em;
    }
    .page-calculator .subtitle {
        font-size: 0.8em;
        margin-bottom: 20px;
    }
    .rates-modal-content {
        max-width: 90vw;
        padding: 20px;
    }
    
    .rates-modal-content h3 {
        font-size: 1em;
    }
    
    .info-button {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .page-calculator h1 {
        font-size: 1.2em;
    }
    .page-calculator h2 {
        font-size: 1.1em;
    }
}


/* ============================================
   ENCHANTING SIMULATOR - INLINE STYLE CLASSES
   ============================================ */
.sim-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sim-btn-icon {
    vertical-align: middle;
    height: 30px;
    width: 30px;
}

.stone-usage-bar {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 10px;
    font-size: 20px;
}

.stone-counter {
    font-size: 20px;
}

.output-container-full {
    max-height: none;
    overflow-y: visible;
}

.oath-dropdown-container {
    position: relative;
}

.oath-dropdown-btn {
    width: 100%;
    padding: 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #1a1a24;
    color: #aaa;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.oath-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a24;
    border: 1px solid #555;
    border-radius: 4px;
    margin-top: 4px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.oath-btn-icon {
    width: 24px;
    height: 24px;
}

.oath-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-top: 15px;
    min-height: 80px;
}

.oath-icon-box {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.05);
    border: 2px solid #555;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oath-icon-box img {
    width: 60px;
    height: 60px;
}

.oath-placeholder {
    color: #666;
    font-size: 0.85em;
    text-align: center;
}

.oath-detail { flex: 1; }

.oath-label { color: #aaa; font-size: 0.9em; margin-bottom: 5px; }

.oath-name { color: #fff; font-size: 1.1em; font-weight: bold; }

.oath-rate { color: #ffd700; margin-top: 5px; font-size: 0.9em; }

/* Rates modal heading variants */
.rates-heading-extreme { color: #ff4d4d; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.rates-heading-rune { color: #b565f5; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.rates-heading-ultimate { color: #4da3ff; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.rates-heading-oath { color: #d4af37; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }

/* Rates modal content size variants */
.rates-modal-content-sm { max-width: 600px; border: 1px solid #444; background: #1a1a24; }
.rates-modal-content-lg { max-width: 90%; border: 1px solid #444; background: #1a1a24; }

/* Rate tables */
.rates-table { width: 100%; border-collapse: collapse; text-align: center; font-size: 0.95em; }
.rates-table thead tr { border-bottom: 2px solid #333; color: #aaa; }
.rates-table th { padding: 10px; }
.rates-table tbody { font-weight: bold; }
.rates-table tbody tr { border-bottom: 1px solid #2a2a35; }
.rates-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.rates-table td { padding: 10px; }

/* Rate info box under tables */
.rates-info {
    margin-top: 15px;
    font-size: 0.85em;
    color: #888;
    text-align: left;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 5px;
}

.rates-info p { margin: 0 0 8px 0; }
.rates-info p:last-child { margin-bottom: 0; }

.rates-info-lg { margin-top: 20px; padding: 15px; background: rgba(0,0,0,0.3); border-radius: 8px; font-size: 0.85em; text-align: left; }
.rates-info-lg p { margin: 0 0 8px 0; line-height: 1.4; }
.rates-info-lg p:last-child { margin-bottom: 0; }

.rates-subheading { color: #ffd700; margin-top: 20px; margin-bottom: 10px; }

.rates-table-bordered th,
.rates-table-bordered td { border: 1px solid #333; }
.rates-table-bordered thead tr { background: #0f0f12; border-bottom: 2px solid #ffd700; }
.rates-table-bordered th.rates-level-col { font-size: 0.9em; padding: 8px; }

.rates-table .rates-icon-cell { width: 80px; }
.rates-table .rates-name-cell { text-align: left; }
.rates-table .rates-icon { width: 32px; height: 32px; border-radius: 4px; }

.rates-penalty-indent { margin-left: 65px; }

/* Color utility classes for rate table cells */
.cell-success { color: #4dfb4d; }
.cell-danger { color: #ff3333; }
.cell-danger-alt { color: #ff4d4d; }
.cell-warning { color: #ffa500; }
.cell-muted { color: #888; }
.cell-legendary { color: #a335ee; }
.cell-ancient { color: #cd7f32; }
.cell-gold { color: #ffd700; }
.cell-white { color: #fff; }

/* Duration legend inner styles */
.duration-legend details { cursor: pointer; }
.duration-legend .dl-content { margin-top: 15px; color: #d0d0d0; line-height: 1.8; }
.duration-legend .dl-item { margin-bottom: 15px; }
.duration-legend .dl-separator { margin-bottom: 15px; padding-top: 10px; border-top: 1px solid #3d3d45; }
.duration-legend .dl-sub { margin-left: 10px; margin-bottom: 8px; }
.duration-legend .dl-note { color: #999; font-size: 0.85em; }
.duration-legend .dl-item strong { color: var(--warning); }
.duration-legend .dl-item strong.accent { color: var(--accent); }

.result-details label { display: block; margin-bottom: 6px; }
.result-details .input-sm { width: 220px; }

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

/* Firefox */
.output-container,
.rates-modal-content,
.oath-dropdown-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(181, 101, 245, 0.45) rgba(0, 0, 0, 0.2);
}

/* Webkit (Chrome, Edge, Safari) */
.output-container::-webkit-scrollbar,
.rates-modal-content::-webkit-scrollbar,
.oath-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.output-container::-webkit-scrollbar-track,
.rates-modal-content::-webkit-scrollbar-track,
.oath-dropdown-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.output-container::-webkit-scrollbar-thumb,
.rates-modal-content::-webkit-scrollbar-thumb,
.oath-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(181, 101, 245, 0.45);
    border-radius: 3px;
}

.output-container::-webkit-scrollbar-thumb:hover,
.rates-modal-content::-webkit-scrollbar-thumb:hover,
.oath-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: rgba(181, 101, 245, 0.75);
}

/* Event toggle button */
.event-toggle-btn {
    padding: 8px 16px;
    background: rgba(100, 100, 120, 0.4);
    border: 1px solid #666;
    color: #aaa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.event-toggle-btn:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffd700;
}

.event-toggle-btn.active {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}
.result-note { color: #999; font-size: 0.85em; }
