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

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

.calculator-container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.calculator-title {
    text-align: center;
    color: #1a73e8;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 500;
    color: #333;
    font-size: 15px;
}

.input-group select,
.input-group input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.input-group input:invalid {
    border-color: #d93026;
}

.input-group .unit {
    color: #666;
    font-weight: 400;
    margin-left: 5px;
    font-size: 14px;
}

.input-row {
    display: flex;
    gap: 20px;
}

.input-row .input-group {
    flex: 1;
}

.calculate-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #1a73e8;
    color: #ffffff;
}

.calculate-btn:hover:not(:disabled) {
    background-color: #1557b0;
    transform: translateY(-1px);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 10;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #666;
    font-size: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



.info-section {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    font-size: 16px;
}

.info-icon {
    font-size: 18px;
}

.info-toggle {
    margin-left: auto;
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.info-section[open] .info-toggle {
    transform: rotate(180deg);
}

.info-content {
    padding: 20px;
    background: #fff;
}

.info-section-item {
    margin-bottom: 25px;
}

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

.info-section-item h4 {
    color: #1a73e8;
    margin-bottom: 15px;
    font-size: 16px;
}

.info-section-item h5 {
    color: #333;
    margin: 15px 0 10px;
    font-size: 14px;
}

.info-section-item p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 10px;
    font-size: 14px;
}

.info-section-item ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.info-section-item li {
    color: #555;
    line-height: 1.8;
    margin-bottom: 8px;
    font-size: 14px;
}

.formula {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #1a73e8;
    font-weight: 500;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table.small {
    font-size: 12px;
}

.data-table th,
.data-table td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

.data-table th {
    position: sticky;
    top: 0;
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
    text-align: center;
    z-index: 1;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.data-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

.tags-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tags-section {
    margin-bottom: 10px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tags span {
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tags span:hover {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

.download-section {
    margin: 15px 0;
}

.download-btn {
    padding: 10px 20px;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #059669;
}

@media (max-width: 600px) {
    .calculator-container {
        padding: 20px;
    }

    .calculator-title {
        font-size: 20px;
    }

    .input-row {
        flex-direction: column;
    }

    .button-row {
        flex-direction: column;
    }

    .calculate-btn,
    .reset-btn {
        width: 100%;
    }

    .result-item .value {
        font-size: 24px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }

    .tags {
        max-height: 100px;
    }
}

.batch-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
}

.batch-section h2 {
    color: #1a73e8;
    margin-bottom: 20px;
    font-size: 18px;
}

.batch-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.batch-form .input-group {
    margin-bottom: 0;
}

.batch-form .input-row {
    margin-bottom: 0;
}

.batch-table-wrapper {
    overflow-x: auto;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
}

.batch-table th,
.batch-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.batch-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
}

.batch-table tbody tr:hover {
    background: #f8f9fa;
}

.batch-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.batch-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

.batch-total {
    text-align: right;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.batch-total span {
    color: #1a73e8;
    font-size: 20px;
}

.clear-all-btn {
    width: 100%;
    padding: 12px 24px;
    background-color: #d93026;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-all-btn:hover {
    background-color: #b92824;
    transform: translateY(-1px);
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 3px;
}

.action-btn.view-btn {
    background-color: #1a73e8;
    color: #fff;
}

.action-btn.view-btn:hover {
    background-color: #1557b0;
}

.action-btn.delete-btn {
    background-color: #d93026;
    color: #fff;
}

.action-btn.delete-btn:hover {
    background-color: #b92824;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-modal:hover {
    color: #d93026;
    transform: scale(1.1);
}

.modal-content h3 {
    color: #1a73e8;
    margin-bottom: 20px;
    font-size: 18px;
    padding-right: 30px;
}

.modal-body {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.modal-body li {
    margin-bottom: 10px;
}

.modal-body .step-title {
    font-weight: 600;
    color: #1a73e8;
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 15px;
}

.modal-body .formula {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin: 10px 0;
    border: 1px solid #e0e0e0;
}

.modal-body .highlight {
    font-weight: 700;
    color: #1a73e8;
}

.modal-body .interpolation-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.modal-body .interpolation-table th,
.modal-body .interpolation-table td {
    border: 1px solid #b3d7ff;
    padding: 8px 12px;
    text-align: center;
}

.modal-body .interpolation-table th {
    background: #e8f0fe;
    font-weight: 600;
}

@media (max-width: 600px) {
    .batch-section {
        padding: 15px;
    }

    .batch-section h2 {
        font-size: 16px;
    }

    .batch-table {
        font-size: 12px;
    }

    .batch-table th,
    .batch-table td {
        padding: 8px 10px;
    }

    .batch-total {
        font-size: 14px;
    }

    .batch-total span {
        font-size: 18px;
    }

    .modal-content {
        margin: 10% auto;
        padding: 20px;
        max-width: 95%;
    }

    .action-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}