/* Unit Converter Styles */
.unit-wrapper {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

.unit-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.unit-header {
    text-align: center;
    margin-bottom: 30px;
}

.unit-header h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 8px;
}

.unit-header .subtitle {
    color: #666;
    font-size: 16px;
}

/* Converter Controls */
.unit-converter {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.converter-controls {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
}

.control-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.control-group select:focus {
    border-color: #ff7a18;
    outline: none;
}

/* Converter Grid */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.input-section label,
.output-section label {
    display: block;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
}

.input-section select,
.output-section select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
    margin-bottom: 10px;
}

.input-section select:focus,
.output-section select:focus {
    border-color: #ff7a18;
    outline: none;
}

.input-section input,
.output-section input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: #fff;
}

.input-section input:focus {
    border-color: #ff7a18;
    outline: none;
}

.output-section input {
    background: #f0f0f0;
    color: #333;
    cursor: default;
}

.swap-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 25px;
}

.btn-swap {
    padding: 10px 15px;
    background: #ff7a18;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-swap:hover {
    background: #e06a0e;
    transform: rotate(180deg);
    box-shadow: 0 4px 12px rgba(255, 122, 24, 0.3);
}

/* Quick Presets */
.quick-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.quick-presets label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
    margin-right: 5px;
}

.quick-presets button {
    padding: 6px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    font-weight: 500;
}

.quick-presets button:hover {
    border-color: #ff7a18;
    background: #fff3e6;
    color: #ff7a18;
    transform: translateY(-2px);
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    flex: 1;
    min-width: 100px;
}

.btn-copy-result {
    background: #28a745;
    color: white;
}

.btn-copy-result:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-save-result {
    background: #ffc107;
    color: #333;
}

.btn-save-result:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-clear-result {
    background: #dc3545;
    color: white;
}

.btn-clear-result:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* History */
.conversion-history {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.conversion-history h3 {
    color: #333;
    margin-bottom: 15px;
}

#historyList {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
}

.history-item .history-value {
    font-weight: 500;
    color: #333;
}

.history-item .history-detail {
    color: #666;
}

.history-item .history-time {
    color: #999;
    font-size: 12px;
}

.btn-clear-history {
    margin-top: 10px;
    padding: 8px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-clear-history:hover {
    background: #c82333;
}

/* Toast */
.toast {
    visibility: hidden;
    min-width: 280px;
    background: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 14px 20px;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    font-weight: 500;
    font-size: 14px;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.info {
    background: #17a2b8;
}

/* Responsive */
@media (max-width: 768px) {
    .converter-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .swap-section {
        padding-top: 0;
    }
    
    .btn-swap {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .quick-presets {
        justify-content: center;
    }
    
    .quick-presets button {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions button {
        width: 100%;
    }
    
    .unit-wrapper {
        padding: 10px;
    }
    
    .unit-container {
        padding: 15px;
    }
}

@media (max-width: 400px) {
    .unit-header h1 {
        font-size: 24px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}