/* Import global CSS variables */
@import url('../../../assets/css/global.css');

/* Calculator Container */
.calculator-container {
    max-width: 700px;
    margin: 2rem auto;
}

/* Form Styles */
.calculator-form {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background-color: #f9fafb;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    flex: 1;
    color: var(--text-color);
    font-weight: 400;
}

/* Subjects Container */
.subjects-container {
    margin-bottom: 1.5rem;
}

.subjects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.subjects-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-color);
    font-weight: 600;
}

.btn-add {
    padding: 0.5rem 1rem;
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-add:hover {
    background-color: #059669;
}

.subject-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.subject-item input[type="text"] {
    flex: 2;
}

.subject-item input[type="number"] {
    flex: 1;
    min-width: 100px;
}

.btn-remove {
    padding: 0.75rem 1rem;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.btn-remove:hover {
    background-color: #dc2626;
}

/* Button Styles */
.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
    background-color: var(--hover-color);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Results Box */
.results-box {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background-color: #f9fafb;
}

.results-box h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-color);
}

.aps-notes {
    background-color: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-color);
    line-height: 1.6;
}

.aps-table-container {
    overflow-x: auto;
}

.aps-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 0.375rem;
    overflow: hidden;
}

.aps-table thead {
    background-color: var(--primary-color);
    color: white;
}

.aps-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aps-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.aps-table tbody tr:hover {
    background-color: #f9fafb;
}

.aps-table tbody tr:last-child td {
    border-bottom: none;
}

.aps-table tfoot {
    background-color: #f3f4f6;
    font-weight: 600;
}

.aps-total td {
    padding: 1rem 0.75rem;
    font-size: 1.125rem;
    color: var(--primary-color);
}

.aps-table .adjusted {
    color: #10b981;
    font-weight: 500;
}

.aps-table .excluded {
    color: var(--text-secondary);
    font-style: italic;
}

/* Ad Slot */
.ad-slot {
    text-align: center;
    padding: 2rem;
    background-color: #f3f4f6;
    border: 1px dashed var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design (Mobile-First) */
@media (max-width: 640px) {
    .subject-item {
        flex-direction: column;
    }

    .subject-item input {
        width: 100%;
    }

    .btn-remove {
        width: 100%;
    }

    .subjects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .btn-add {
        width: 100%;
    }
}

@media (min-width: 640px) {
    .calculator-container {
        margin: 3rem auto;
    }

    .calculator-form {
        padding: 2.5rem;
    }

    .results-box {
        padding: 2rem;
    }
}

