/* DirectionDriven - Towing Calculator Styles */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: #f5f7fa;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Container */
main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Section Styling */
section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

section:hover {
    box-shadow: var(--shadow-hover);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

section h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

input[type="number"]:invalid {
    border-color: var(--danger-color);
}

.input-hint {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

/* Button Styling */
button {
    background-color: var(--secondary-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 100%;
    margin-top: 1rem;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* Results Display */
#results {
    display: none;
}

#results.show {
    display: block;
}

.result-status {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

.result-status.safe {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid var(--success-color);
}

.result-status.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 2px solid var(--warning-color);
}

.result-status.danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid var(--danger-color);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background-color: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.result-label {
    font-weight: 600;
    color: var(--primary-color);
}

.result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.recommendations {
    background-color: #e8f4f8;
    border-left: 4px solid var(--secondary-color);
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-radius: 8px;
}

.recommendations h3 {
    margin-top: 0;
    color: var(--secondary-color);
}

.recommendations ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.recommendations li {
    margin-bottom: 0.5rem;
}

/* Educational Content */
.info-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--secondary-color);
}

.info-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.info-card ul {
    margin-left: 1.5rem;
}

.info-card li {
    margin-bottom: 0.5rem;
}

.hitch-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.hitch-table th,
.hitch-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.hitch-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.hitch-table tr:hover {
    background-color: var(--light-bg);
}

/* Grid Layout for Form */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Two Column Layout for Main Content */
.two-column {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .two-column {
        grid-template-columns: 1fr 1fr;
    }
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

/* Footer Navigation */
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .footer-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    section {
        padding: 1.5rem;
    }
    
    section h2 {
        font-size: 1.5rem;
    }
    
    button {
        padding: 0.875rem 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    section {
        padding: 1rem;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Accessibility */
*:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header {
        background: var(--primary-color);
    }
    
    section {
        box-shadow: none;
        border: 1px solid var(--border-color);
        page-break-inside: avoid;
    }
    
    button {
        display: none;
    }
    
    .no-print {
        display: none;
    }
}
