/* SoapLyeCalculator.css - 手工皂鹼量計算器專屬樣式 */
/* 注意：不重定義全域類別 (.glass-card, .form-input, .btn-custom 等) */

/* ========== 油脂列表區塊 ========== */
.oil-list-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.oil-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.oil-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.2);
}

.oil-item-select {
    flex: 1;
    min-width: 0;
}

.oil-item-weight {
    width: 100px;
    flex-shrink: 0;
}

.oil-item-percent {
    width: 60px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.oil-remove-btn {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    padding: 5px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.oil-remove-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.add-oil-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px dashed #667eea;
    border-radius: 12px;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-oil-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* ========== 鹼種類選擇 ========== */
.lye-type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.lye-type-option {
    flex: 1;
    padding: 15px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.lye-type-option:hover {
    border-color: #667eea;
}

.lye-type-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.lye-type-option .lye-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 5px;
}

.lye-type-option .lye-desc {
    font-size: 0.85rem;
    color: #718096;
}

/* ========== 安全警告區塊 ========== */
.safety-warning {
    background: linear-gradient(135deg, #fed7d7 0%, #feebc8 100%);
    border: 2px solid #e53e3e;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
}

.safety-warning-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #c53030;
}

.safety-warning-header i {
    font-size: 1.5rem;
}

.safety-section {
    margin-bottom: 15px;
}

.safety-section:last-child {
    margin-bottom: 0;
}

.safety-section-title {
    font-weight: 600;
    color: #c53030;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.safety-section ul {
    margin: 0;
    padding-left: 20px;
    color: #742a2a;
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ========== 結果卡片 ========== */
.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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-family: 'Poppins', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
}

.result-unit {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-left: 5px;
}

.result-divider {
    border-color: rgba(255, 255, 255, 0.2);
    margin: 15px 0;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.result-item-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.result-item-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
}

/* ========== INS 儀表板 ========== */
.ins-gauge-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 20px 0;
}

.ins-gauge {
    position: relative;
    width: 100%;
    padding-bottom: 50%;
    overflow: hidden;
}

.ins-gauge-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    border-radius: 50%;
    background: conic-gradient(
        #e53e3e 0deg 86deg,
        #38a169 86deg 122deg,
        #e53e3e 122deg 180deg
    );
    clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
}

.ins-gauge-inner {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 140%;
    background: white;
    border-radius: 50%;
}

.ins-gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 45%;
    background: #2d3748;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.5s ease;
    border-radius: 2px;
}

.ins-gauge-center {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #2d3748;
    border-radius: 50%;
    transform: translate(-50%, 50%);
}

.ins-value-display {
    text-align: center;
    margin-top: 20px;
}

.ins-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
}

.ins-status {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 5px;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
}

.ins-status.ideal {
    background: #c6f6d5;
    color: #276749;
}

.ins-status.soft {
    background: #fed7d7;
    color: #c53030;
}

.ins-status.hard {
    background: #feebc8;
    color: #c05621;
}

.ins-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 0.85rem;
}

.ins-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ins-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.ins-legend-color.soft {
    background: #e53e3e;
}

.ins-legend-color.ideal {
    background: #38a169;
}

.ins-legend-color.hard {
    background: #e53e3e;
}

/* ========== 雷達圖 ========== */
.radar-chart-container {
    position: relative;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ========== 配方特性列表 ========== */
.properties-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.property-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.property-name {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 5px;
}

.property-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
}

.property-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.property-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ========== 油脂分類標籤 ========== */
.oil-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.oil-category-tab {
    padding: 8px 16px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.oil-category-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.oil-category-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* ========== 水量計算方式 ========== */
.water-method-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.water-method-option {
    flex: 1;
    padding: 10px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.water-method-option:hover {
    border-color: #667eea;
}

.water-method-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    font-weight: 600;
}

/* ========== 輸入區域樣式 ========== */
.input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.input-group-custom {
    flex: 1;
}

.input-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.input-label i {
    color: #667eea;
    margin-right: 5px;
}

.input-wrapper {
    position: relative;
}

.input-range {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 4px;
}

/* ========== 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;
    margin-left: 5px;
    position: relative;
}

.tooltip-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: pre-line;
    min-width: 200px;
    max-width: 320px;
    text-align: left;
    line-height: 1.5;
    z-index: 100;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2d3748;
}

/* ========== 配方範本 ========== */
.recipe-templates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.recipe-template-btn {
    padding: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.recipe-template-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateY(-2px);
}

.recipe-template-btn i {
    display: block;
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 8px;
}

.recipe-template-btn span {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
}

.recipe-template-btn small {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    margin-top: 3px;
}

/* ========== 響應式設計 ========== */
@media (max-width: 992px) {
    .result-details {
        grid-template-columns: 1fr;
    }

    .properties-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
        gap: 10px;
    }

    .lye-type-selector {
        flex-direction: column;
        gap: 10px;
    }

    .water-method-selector {
        flex-direction: column;
    }

    .oil-item {
        flex-wrap: wrap;
    }

    .oil-item-select {
        width: 100%;
        flex: none;
    }

    .oil-item-weight {
        width: calc(50% - 25px);
    }

    .ins-legend {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .recipe-templates {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .result-value {
        font-size: 2.2rem;
    }

    .ins-value {
        font-size: 2rem;
    }

    .recipe-templates {
        grid-template-columns: 1fr;
    }
}
