* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 25px 20px 15px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.tab-container {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 4px;
    margin: 0 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: #4CAF50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.content {
    padding: 30px 20px;
}

.tab-content {
    display: none;
}

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

.input-section {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 25px;
}

.input-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.input-field {
    flex: 1;
    max-width: calc(100% - 60px);
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 18px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-field:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.voice-btn {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
    border: none !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #FF6B6B 0%, #ee5a52 100%);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1/1 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

.voice-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.listening {
    background: linear-gradient(135deg, #FF4444 0%, #cc0000 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
}

.unit-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.unit-btn {
    padding: 15px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #f8f9fa;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.unit-btn:hover {
    border-color: #4CAF50;
    color: #4CAF50;
}

.unit-btn.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-color: #4CAF50;
    transform: translateY(2px);
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.2);
}

.result-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
}

.result-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 5px;
}

.result-unit {
    font-size: 18px;
    color: #888;
}

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

.action-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.action-btn:active {
    transform: translateY(0);
}

.status-message {
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.history-section {
    margin-top: 30px;
}

.history-title {
    font-size: 18px;
    color: #555;
    margin-bottom: 15px;
    text-align: center;
}

.history-list {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    border-left: 4px solid #4CAF50;
}

.history-item:last-child {
    margin-bottom: 0;
}

.no-history {
    text-align: center;
    color: #999;
    font-style: italic;
    margin: 0;
}

.discount-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.discount-type-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.discount-type-btn:hover {
    border-color: #4CAF50;
    color: #4CAF50;
}

.discount-type-btn.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-color: #4CAF50;
}

.discount-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #4CAF50;
}

.result-item .result-label {
    font-size: 16px;
    color: #666;
    font-weight: 600;
}

.result-item .result-value {
    font-size: 18px;
    font-weight: 700;
    color: #4CAF50;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .content {
        padding: 20px 15px;
    }

    .unit-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .discount-type-selector {
        flex-direction: column;
    }
}