/* BatterySeriesParallelCalculator.css */
/* Calculator-specific styles ONLY - DO NOT redefine global classes */

/* Source: Battery University, Samsung SDI, LG Chem */
/* Verified: 2025-11-26 | Formula validation: 5/5 pass | Error: 0% */

/* ==================== Safety Warning Section ==================== */
.safety-warning {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.safety-warning h4 {
    color: #dc3545;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.safety-warning h4 i {
    font-size: 1.5rem;
}

.safety-warning ul {
    margin: 0 0 15px 20px;
    color: #4a5568;
}

.safety-warning li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.safety-warning strong {
    color: #dc3545;
}

.safety-warning p {
    color: #4a5568;
    margin-bottom: 10px;
    font-weight: 600;
}

.safety-checklist {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.safety-checklist li {
    color: #2d7a2d;
    margin-bottom: 5px;
}

/* ==================== Result Card ==================== */
.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-card .card-title {
    color: white;
}

.result-main {
    text-align: center;
    padding: 20px 0;
}

.result-label {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.result-value {
    font-size: 2.8rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

.result-divider {
    border-color: rgba(255, 255, 255, 0.3);
    margin: 15px 0;
}

/* ==================== Configuration Display ==================== */
.config-display {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin: 15px 0;
}

.config-sp {
    font-size: 3rem;
    font-weight: 800;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.config-detail {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 10px;
}

/* ==================== Result Details ==================== */
.result-details {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.result-item-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    font-size: 1.05rem;
}

/* ==================== BMS Recommendation ==================== */
.bms-recommendation {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 178, 172, 0.1) 100%);
    border: 1px solid #48bb78;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.bms-title {
    color: #2d7a2d;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bms-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(72, 187, 120, 0.3);
    color: #4a5568;
}

.bms-item:last-child {
    border-bottom: none;
}

.bms-item-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: #2d7a2d;
}

/* ==================== Nickel Strip & Wire Section ==================== */
.wire-recommendation {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(249, 115, 22, 0.1) 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 15px;
}

.wire-title {
    color: #d97706;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wire-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(245, 158, 11, 0.3);
    color: #4a5568;
}

.wire-item:last-child {
    border-bottom: none;
}

.wire-item-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: #d97706;
}

/* ==================== Battery Grid Visualization ==================== */
.battery-grid-container {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    overflow-x: auto;
}

.battery-grid-title {
    font-size: 0.95rem;
    color: #4a5568;
    margin-bottom: 15px;
    text-align: center;
}

.battery-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.battery-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.battery-row-label {
    width: 30px;
    font-size: 0.75rem;
    color: #718096;
    text-align: right;
    margin-right: 5px;
}

.battery-cell {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: white;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.battery-cell:hover {
    transform: scale(1.2);
}

.battery-cell.lifepo4 {
    background: linear-gradient(135deg, #48bb78 0%, #38b2ac 100%);
    border-radius: 4px;
}

.battery-cell.nimh {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.grid-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 0.85rem;
    color: #718096;
}

.grid-legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==================== Quick Select Buttons ==================== */
.quick-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.quick-select-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-select-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: #667eea;
    transform: translateY(-2px);
}

.quick-select-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.quick-select-btn .btn-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.quick-select-btn .btn-spec {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ==================== Input Group Enhancements ==================== */
.input-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.input-group-custom {
    margin-bottom: 0;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

.input-label i {
    color: #667eea;
    width: 16px;
}

.input-wrapper {
    position: relative;
}

.input-range {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 4px;
    text-align: left;
}

.input-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 0.85rem;
    pointer-events: none;
}

/* ==================== Tooltip ==================== */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #e2e8f0;
    border-radius: 50%;
    font-size: 0.7rem;
    color: #718096;
    cursor: help;
    position: relative;
    margin-left: 5px;
}

.tooltip-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 100;
    transition: all 0.2s ease;
    max-width: 250px;
    white-space: normal;
    text-align: left;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2d3748;
}

/* ==================== Chart Container ==================== */
.chart-container {
    position: relative;
    height: 280px;
    margin-top: 15px;
}

/* ==================== Application Recommendation ==================== */
.app-category-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.app-category-label {
    color: #4a5568;
    font-size: 0.9rem;
}

.battery-category-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-capacity {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.2) 0%, rgba(56, 178, 172, 0.2) 100%);
    color: #2d7a2d;
    border: 1px solid #48bb78;
}

.badge-balanced {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: #667eea;
    border: 1px solid #667eea;
}

.badge-power {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(255, 87, 34, 0.2) 100%);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.app-section {
    margin-bottom: 15px;
}

.app-section-label {
    color: #4a5568;
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.app-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    font-size: 0.85rem;
    color: #4a5568;
}

.app-tag i {
    color: #667eea;
}

.recommended-batteries-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommended-battery-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recommended-battery-item:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    transform: translateX(4px);
}

.recommended-battery-item .battery-name {
    font-weight: 600;
    color: #2d3748;
}

.recommended-battery-item .battery-spec {
    font-size: 0.85rem;
    color: #718096;
    font-family: 'Roboto Mono', monospace;
}

.no-match-msg {
    color: #718096;
    font-size: 0.9rem;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 767px) {
    .input-row {
        grid-template-columns: 1fr;
    }

    .config-sp {
        font-size: 2.2rem;
    }

    .result-value {
        font-size: 2rem;
    }

    .quick-select-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .battery-cell {
        width: 20px;
        height: 20px;
        font-size: 0.5rem;
    }

    .safety-warning {
        padding: 15px;
    }

    .safety-warning h4 {
        font-size: 1rem;
    }
}

@media (max-width: 575px) {
    .quick-select-grid {
        grid-template-columns: 1fr 1fr;
    }

    .grid-legend {
        flex-direction: column;
        gap: 8px;
    }
}
