/* Variables */
:root {
    --primary-color: #8D2BCF;
    --primary-hover: #7320A3;
    --background-color: #FBF9FC;
    --text-color: #1A1A1A;
    --gray-100: #f8f9fa;
    --gray-600: #6c757d;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --spacing-sm: 0.50rem;
    --spacing-md: 1.00rem;
    --spacing-lg: 1.50rem;
}

/* Container */
.calculator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    font-family: 'DM Sans', sans-serif;
}

/* Card */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: var(--spacing-lg);
    background: white;
}

.card-header {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.card-header h4,
.card-header h5 {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-sm {
    width: 100%;
    margin-bottom: 0;
}

.table-sm td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

.table-sm td:first-child {
    text-align: left;
    padding-left: 1rem;
}

.table-sm td:not(:first-child),
.text-end {
    text-align: right;
    padding-right: 1rem;
    min-width: 150px;
}

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

/* Status Indicators */
.status-indicator {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
}

.status-indicator.pass {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.status-indicator.fail {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.status-indicator::after {
    font-weight: bold;
}

.status-indicator.pass::after {
    content: " ✓";
}

.status-indicator.fail::after {
    content: " ✗";
}

/* Alert styling for status indicators */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
}

/* Results Section Styling */
.results-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.results-section h4 {
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.5rem;
}

.results-section .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.results-section p.text-muted {
    color: var(--gray-600) !important;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Enhanced Alert Styling */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-weight: 500;
    position: relative;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.25);
    color: #155724;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.25);
    color: #721c24;
}

.alert .fas {
    color: inherit;
    margin-right: 0.5rem;
}

.alert-heading {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Enhanced Card Styling */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    background: white;
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.card-header h5, 
.card-header h6 {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.card-header h6 {
    font-size: 1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Enhanced Table Styling */
.table-sm {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table-sm td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    line-height: 1.4;
}

.table-sm td:first-child {
    text-align: left;
    color: var(--gray-600);
    font-weight: 500;
}

.table-sm td:not(:first-child),
.text-end {
    text-align: right;
    font-weight: 500;
    color: var(--text-color);
}

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

.table-active {
    background-color: rgba(141, 43, 207, 0.05) !important;
}

.table-active td {
    border-bottom: 1px solid rgba(141, 43, 207, 0.15) !important;
}

/* Badge Styling */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

/* Container-specific button styling - scoped to avoid navbar conflicts */

/* Utility Classes */
.fw-bold {
    font-weight: 700 !important;
}

.fw-medium {
    font-weight: 500 !important;
}

.w-50 {
    width: 50% !important;
}

.w-60 {
    width: 60% !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.me-3 {
    margin-right: 1rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.text-center {
    text-align: center !important;
}

.text-end {
    text-align: right !important;
}

.text-muted {
    color: var(--gray-600) !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

/* Status Indicators (Legacy - keep for backward compatibility) */
.status-indicator {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
}

.status-indicator.pass {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.status-indicator.fail {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-color);
}

.input-group {
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    position: relative;
}

.input-group-text {
    background-color: var(--gray-100);
    border: 1px solid var(--border-color);
    color: var(--gray-600);
    font-size: 0.875rem;
    min-width: 3.5rem;
    justify-content: center;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
}

/* Dropdown Styles */
.form-select {
    display: block !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
    background-image: none !important;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select option {
    display: block !important;
    padding: 8px 12px !important;
    background-color: white !important;
    color: #212529 !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.1);
    outline: none;
}

/* Calculator-specific button styling */
.calculator-container .btn-calculate,
.calculator-container .btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    width: auto;
    min-width: 200px;
}

.calculator-container .btn-calculate:hover,
.calculator-container .btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Section Groups */
.section-group {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-100);
}

.section-group:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.section-group h5 {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

/* Form Validation */
.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Row Spacing */
.row {
    margin-bottom: var(--spacing-sm);
}

.row:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .calculator-container {
        padding: 1rem;
    }
    
    .card-header,
    .card-body {
        padding: 1rem;
    }
    
    .table-sm td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .table-sm td:not(:first-child) {
        min-width: 120px;
    }
}