/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Header styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: .4rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: none;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Column styles */
.column {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    padding: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.column:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.column h2 {
    color: #667eea;
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 0.5rem;
}

/* Form styles */
.form-section {
    margin-bottom: 2rem;
}

.form-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0rem;
}

.form-field-row label {
    font-weight: 500;
    color: #555;
    min-width: 140px;
    font-size: 0.95rem;
}

/* Input and select styling */
.form-field-row input,
.form-field-row select {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fafbfc;
    min-width: 120px;
}

.form-field-row input:focus,
.form-field-row select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-field-row select {
    background-color: #fafbfc;
    cursor: pointer;
}

.form-field-row input:hover,
.form-field-row select:hover {
    border-color: #667eea;
}

/* Time group styling for inline time and time_mode */
.time-group {
    align-items: center;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

.time-inputs input {
    max-width: 80px;
    min-width: 80px;
}

.time-inputs select {
    min-width: 80px;
    max-width: 100px;
}

.time-separator {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    padding: 0 0.25rem;
}

/* Button styling */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    width: 100%;
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

/* Results section */
.plot-container {
    text-align: center;
    margin: 1.5rem 0;
}

.plot-container img {
    max-width: 100%;
    height: auto;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.plot-container img:hover {
    transform: scale(1.02);
}

/* Error and validation styles */
.error {
    color: #e74c3c;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
}

form ul.errorlist {
    color: #e74c3c;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    font-size: 0.9em;
    font-weight: 500;
    background: rgba(231, 76, 60, 0.1);
    border-left: 3px solid #e74c3c;
    padding: 0.5rem;
    border-radius: 4px;
}

.errorlist li {
    font-size: 0.85rem;
    color: #e74c3c;
}

/* Parameter info sections */
.param-info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

.param-info h3 {
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.param-info p {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

/* Form groups */
.form-group {
    margin-bottom: 0.5rem;
}

.form-group h3 {
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
    border-bottom: 2px solid #e1e5e9;
    padding-bottom: 0.2rem;
}

.input-box select {
    width: 100%;
    min-width: 150px;
}

/* Info boxes */
.info-box {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Parameter grid styling */
.param-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.param-grid div {
    padding: 0.25rem 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.param-grid div:hover {
    background-color: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
}

/* Disabled inputs */
input[disabled] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Loading state for buttons */
.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Scientific notation styling */
sub, sup {
    font-size: 0.8em;
}

/* Responsive design */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .column {
        padding: 1.5rem;
    }
    
    .form-field-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .form-field-row label {
        min-width: auto;
    }
    
    /* Time group responsive */
    .time-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .time-inputs {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
    
    .time-inputs input,
    .time-inputs select {
        flex: 1;
        min-width: 70px;
    }
}

/* Footer styling */
footer {
    border-top: 1px solid #e1e5e9;
    margin-top: 3rem;
    padding: 2rem;
    text-align: center;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
}

/* Footer logos container */
.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1rem;
}

.footer-logos a {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.footer-logos a:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

.footer-logo {
    max-height: 50px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: filter 0.3s ease;
}

.footer-logo:hover {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* Responsive footer logos */
@media (max-width: 768px) {
    .footer-logos {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .footer-logo {
        max-height: 40px;
    }
}

footer a:hover {
    color: #4c63d2 !important;
    text-decoration: underline !important;
}