:root {
    --primary-color: #dc0032;
    --primary-hover: #b80029;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --error-color: #dc3545;
    --border-color: #ddd;
    --text-color: #333;
    --bg-light: #f8f9fa;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Header */
header {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 30px;
}

/* Form */
.calculator-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

input.error,
select.error {
    border-color: var(--error-color);
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 5px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 0, 50, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Results */
.results {
    margin-top: 30px;
}

.results h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: var(--shadow);
    border-radius: 6px;
    overflow: hidden;
}

.results-table th,
.results-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.results-table thead {
    background: var(--bg-light);
}

.results-table th {
    font-weight: 600;
    color: var(--text-color);
}

.results-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.results-table th.sortable:hover {
    background: #e9ecef;
}

.sort-icon {
    margin-left: 5px;
    font-size: 0.875rem;
}

.results-table tbody tr:hover {
    background: var(--bg-light);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-table code {
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.results-table .price {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.125rem;
}

/* Footer */
footer {
    background: var(--bg-light);
    padding: 20px;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* Choices.js Customization */
.choices__inner {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    min-height: 48px;
}

.choices__inner:focus,
.is-focused .choices__inner {
    border-color: var(--primary-color);
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    main {
        padding: 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .results-table {
        font-size: 0.875rem;
    }

    .results-table th,
    .results-table td {
        padding: 10px;
    }
}
