/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Calculator Section */
.calculator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.calculator-form {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.calculator-result {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Input Methods Tabs */
.input-methods {
    margin-bottom: 20px;
}

.method-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #2a5298;
    border-bottom: 2px solid #2a5298;
    font-weight: 600;
}

.tab-btn:hover {
    color: #2a5298;
}

.method-panel {
    display: none;
}

.method-panel.active {
    display: block;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border 0.3s;
}

input[type="number"]:focus {
    border-color: #2a5298;
    outline: none;
}

.calculate-btn {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
    width: 100%;
    margin-bottom: 10px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.3);
}

.reset-btn {
    background: #f0f0f0;
    color: #666;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
}

.reset-btn:hover {
    background: #e0e0e0;
}

/* Result Display */
.result-display h3 {
    color: #1e3c72;
    margin-bottom: 20px;
    text-align: center;
}

.result-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #2a5298;
}

.result-label {
    font-weight: 600;
    color: #555;
}

.result-value {
    font-weight: 700;
    color: #1e3c72;
}

/* Roof Diagram */
.roof-diagram {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.roof-diagram h4 {
    text-align: center;
    margin-bottom: 15px;
    color: #444;
}

.diagram-container {
    display: flex;
    justify-content: center;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
}

/* Pitch Reference Table */
.pitch-reference {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.pitch-reference h2 {
    color: #1e3c72;
    margin-bottom: 20px;
    text-align: center;
}

.reference-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #444;
}

tr:hover {
    background-color: #f5f7fa;
}

/* Explanation Section */
.explanation {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.explanation h2 {
    color: #1e3c72;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.explanation p {
    margin-bottom: 15px;
}

.explanation ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.explanation li {
    margin-bottom: 8px;
}

.formula {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    font-family: monospace;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-container {
        flex-direction: column;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .result-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .result-label, .result-value {
        text-align: center;
    }
}