/* Calculator Specific Styles */

/* Main Grid Layout */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 20px;
    margin-top: 20px;
    align-items: start;
}

@media (max-width: 968px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .avatar-display-container {
        order: -1; /* Avatar on top on mobile */
        margin-bottom: 20px;
    }
}

/* Panels */
.stat-panel {
    padding: 20px;
    background: var(--card-background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-panel h3 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Stat Rows */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stat-row label {
    font-weight: bold;
    color: var(--text-color);
}

.stat-row input, .stat-row select {
    width: 80px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.1); /* Slight darker for input */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    text-align: center;
}

.dark-theme .stat-row input, .dark-theme .stat-row select {
     background: rgba(0, 0, 0, 0.3);
     color: white;
}

.stat-row.highlight input {
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.stat-divider {
    height: 1px;
    background: var(--border-color);
    margin: 15px 0;
}

/* Avatar Center Display */
.avatar-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    min-height: 300px;
}

.avatar-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(
        circle,
        rgba(0, 206, 201, 0.2) 0%,
        rgba(0, 0, 0, 0) 70%
    );
    border-radius: 50%;
    z-index: 0;
    animation: pulse 3s infinite ease-in-out;
}

#char-avatar {
    position: relative;
    z-index: 1;
    height: 180px;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
    min-height: 150px; /* Fallback height */
    min-width: 100px;
}

.avatar-placeholder {
    width: 100px;
    height: 150px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
}

#char-avatar:hover {
    transform: scale(1.05);
}

#char-name-display {
    margin-top: 15px;
    font-size: 1.8rem;
    color: var(--text-color);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5); /* Shadow for legibility */
    z-index: 1;
}

.dark-theme #char-name-display {
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.job-badge {
    background: var(--primary-color);
    color: white; /* Badge text usually white on primary */
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 5px;
    z-index: 1;
}

/* Search Section */
.search-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.large-search {
    width: 100%;
    max-width: 600px;
    padding: 10px;
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.large-search input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    width: 100%;
}

.large-search i {
    color: #b2bec3;
    margin-right: 10px;
}

#import-btn {
    margin-left: 10px;
    padding: 8px 20px;
}

/* Bottom Grid (Inventory & Analysis) */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

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

/* Inventory */
.inventory-panel {
    padding: 20px;
    height: 100%;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 15px;
}

.inv-item {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05); /* Slightly lighter */
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help; /* Change cursor to indicate interaction */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    position: relative; 
    z-index: 10; /* Ensure items are clickable */
}

.inv-item:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
}

.inv-item img {
    max-width: 32px;
    max-height: 32px;
}

/* Tooltip (Global Fixed) */
.maple-tooltip {
    display: none;
    position: fixed; /* Fixed to viewport */
    top: 0;
    left: 0;
    width: 280px; 
    background: rgba(10, 15, 25, 0.95); /* Darker background */
    border: 1px solid #444; 
    border-radius: 4px;
    padding: 10px;
    z-index: 2147483647; /* Max Z-Index */
    color: white;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    font-family: "Tahoma", sans-serif;
    font-size: 12px;
    pointer-events: none; /* Crucial so mouse events pass through to underlying elements */
}

.maple-tooltip.fixed-tooltip {
    position: absolute; /* Using absolute relative to body (page coordinates) */
}

/* Old relative tooltip styles removed/superseded */

.ms-item-name {
    text-align: center;
    color: white;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Analysis Panel */
.analysis-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.monster-search-box {
    position: relative;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
}

.monster-search-box input {
    background: transparent;
    border: none;
    color: var(--text-color);
    flex: 1;
    margin-left: 10px;
    font-size: 1rem;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-background);
    background-color: #2d3436; /* Fallback solid color */
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000; /* Increased z-index */
    display: none;
    color: var(--text-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.suggestion-item {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.suggestion-item:hover {
    background: rgba(0,0,0,0.05);
}

.analysis-result {
    margin-top: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.analysis-result.hidden {
    display: none;
}

.monster-info-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0,0,0,0.05); /* Generic subtle bg */
    padding: 15px;
    border-radius: 8px;
}

.monster-info-card img {
    max-height: 60px;
}

.mob-details h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.mob-stats-mini {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.result-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.metric-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-label {
    font-size: 0.8rem;
    color: #b2bec3;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: white;
}

.hit-chance .metric-value {
    color: #00b894;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 206, 201, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(0, 206, 201, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 206, 201, 0);
    }
}
