/* Measurement Input Form Styles */

/* Page Header */
.page-header {
    padding: 8rem 5% 3rem;
    text-align: center;
    margin-top: 3rem;
    background: linear-gradient(135deg, #f5f6fa 0%, #e8eaf6 100%);
}

.header-content h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.header-content p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    padding: 2rem 5% 4rem;
    min-height: calc(100vh - 400px);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 150px;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 60%;
    width: 80%;
    height: 2px;
    background-color: #ddd;
    z-index: 1;
}

.step.active:not(:last-child)::after {
    background-color: var(--secondary-color);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ddd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background-color: var(--secondary-color);
}

.step-label {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.step.active .step-label {
    color: var(--text-color);
    font-weight: 500;
}

.step.completed .step-number {
    background-color: #28a745;
}

.step.completed .step-label {
    color: var(--text-color);
}

a.clickable-step {
    text-decoration: none;
    cursor: pointer;
}

a.clickable-step:hover .step-number {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

a.clickable-step:hover .step-label {
    color: #28a745;
}

/* Form Styles */
.input-form {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.form-section {
    padding: 2rem;
    border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h2 i {
    color: var(--secondary-color);
}

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

.form-group:last-child {
    margin-bottom: 0;
}

/* Labels */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.section-label {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.required {
    color: var(--accent-color);
    margin-left: 2px;
}

/* Input Fields */
input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: white;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Input Wrapper for Combined Inputs */
.input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.input-wrapper input {
    flex: 2;
}

.unit-select,
.method-select {
    flex: 1;
    min-width: 120px;
}

/* Coverage Method Radio Buttons */
.coverage-method {
    margin-bottom: 1.5rem;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: normal;
}

.radio-button {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 0.5rem;
    position: relative;
    transition: border-color 0.3s ease;
}

.radio-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

input[type="radio"]:checked + label .radio-button {
    border-color: var(--secondary-color);
}

input[type="radio"]:checked + label .radio-button::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Confidence Level Options */
.confidence-options {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.preset-buttons {
    display: flex;
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.preset-btn:hover,
.preset-btn.active {
    border-color: var(--secondary-color);
    background-color: var(--secondary-color);
    color: white;
}

.custom-input {
    display: flex;
    align-items: center;
    position: relative;
}

.custom-input input {
    width: 180px;
    padding-right: 25px;
}

.input-suffix {
    position: absolute;
    right: 10px;
    color: #666;
    font-size: 0.9rem;
}

/* Help Text */
.form-help {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Tooltip */
.tooltip-trigger {
    cursor: help;
    color: var(--secondary-color);
    margin-left: 0.25rem;
}

.tooltip {
    position: absolute;
    background: var(--dark-bg);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    max-width: 200px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip.show {
    opacity: 1;
}

/* Form Actions */
.form-actions {
    padding: 2rem;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid #ddd;
}

.btn-outline:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 3%;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .progress-indicator {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .step {
        min-width: 100px;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .confidence-options {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .preset-buttons {
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .input-wrapper input,
    .unit-select,
    .method-select {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 2rem;
    }
    
    .form-section h2 {
        font-size: 1.2rem;
    }
    
    .preset-buttons {
        flex-wrap: wrap;
    }
    
    .preset-btn {
        flex: 1;
        min-width: 60px;
    }
}

/* Form Validation Styles */
input:invalid {
    border-color: var(--accent-color);
}

input:valid {
    border-color: #28a745;
}

.error-message {
    color: var(--accent-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .btn {
    position: relative;
}

.loading .btn::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Load Previous Calculation */
.load-calculation-section {
    margin-bottom: 2rem;
}

.load-calculation-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 2px solid #90caf9;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.load-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.load-header i {
    font-size: 1.8rem;
    color: #1976d2;
}

.load-header h3 {
    margin: 0;
    color: #1976d2;
    font-size: 1.3rem;
}

.load-calculation-card p {
    color: #555;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.load-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-info {
    background: #1976d2;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.btn-info:hover {
    background: #1565c0;
}

.load-status {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.load-status.loading {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.load-status.success {
    background-color: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.load-status.error {
    background-color: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

.load-status i {
    font-size: 1.2rem;
}