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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.calculator {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 700px;
    width: 100%;
}

.title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

.tab-container {
    display: flex;
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 5px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    color: #333;
    background: rgba(102, 126, 234, 0.1);
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.calculator-content {
    display: none;
}

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

.common-fields {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 5px solid #28a745;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 16px;
}

input, select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.result {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.result h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
}

.result-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 18px;
    color: #667eea;
}

.result-label {
    color: #666;
}

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

.error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
}

.popup-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 2px solid #e74c3c;
    border-radius: 15px;
    padding: 20px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-align: center;
    font-size: 16px;
    color: #333;
    max-width: 400px;
    animation: popupShow 0.3s ease-out;
}

.popup-message::before {
    content: "⚠️";
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}

@keyframes popupShow {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hidden {
    display: none;
}

.copy-btn {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

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

.copy-btn.copied {
    background: #17a2b8;
}

.comparison-table {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.comparison-table h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
    white-space: nowrap;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    color: #333;
    font-size: 15px;
}

tr:hover {
    background: #f8f9fa;
}

tr:last-child td {
    border-bottom: none;
}

.highlighted-row {
    background: #e3f2fd !important;
    font-weight: 600;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .calculator {
        padding: 20px;
        margin: 5px;
        max-width: 100%;
    }
    
    .title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .tab-button {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .comparison-table {
        padding: 15px;
        margin-top: 20px;
    }
    
    .comparison-table h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .table-container {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    table {
        min-width: 350px;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    th {
        font-size: 14px;
        font-weight:200;
    }
    
    .result {
        padding: 20px;
        margin-top: 20px;
    }
    
    .result h3 {
        font-size: 18px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-label {
        font-size: 14px;
    }
    
    .result-value {
        font-size: 16px;
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .calculator {
        padding: 15px;
        margin: 0;
        border-radius: 15px;
    }
    
    .title {
        font-size: 20px;
    }
    
    .tab-button {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .comparison-table {
        padding: 10px;
    }
    
    .table-container {
        margin: 0 -10px;
    }
    
    table {
        min-width: 320px;
    }
    
    th, td {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    th {
        font-weight:200;
        font-size: 13px;
    }
    
    .result {
        padding: 15px;
    }
    
    .result h3 {
        font-size: 16px;
    }
    
    .result-item {
        gap: 3px;
    }
    
    .result-label {
        font-size: 13px;
    }
    
    .result-value {
        font-size: 15px;
    }
}
