/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f7f4ed;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px 0;
    background: linear-gradient(135deg, #000000 0%, #ceae5b 100%);
    color: white;
    border-radius: 10px;
    margin: -20px -20px 30px -20px;
}

/* Company Banner Logo */
.company-banner {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.banner-logo {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.banner-logo:hover {
    transform: scale(1.02);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.header h2 {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 15px;
    opacity: 0.9;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 300;
}

/* Navigation Styles */
.navigation {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    border: 2px solid white;
}

/* Main Content */
.main-content {
    margin-bottom: 30px;
}

section {
    margin-bottom: 30px;
}

h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3498db;
    font-weight: 600;
}

h4 {
    font-size: 1.4rem;
    color: #34495e;
    margin-bottom: 15px;
    font-weight: 600;
}

h5 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    background: #2c3e50;
    color: white;
    border-radius: 10px;
    margin: 30px -20px -20px -20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .header h2 {
        font-size: 1.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
}

/* ===========================================
   CALCULATOR PAGE STYLES
   =========================================== */

/* Calculator Section */
.calculator-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
}

.calculator-description {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 25px;
    text-align: center;
    font-style: italic;
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

.calculator-inputs {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.input-group label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 120px;
}

.input-group input {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    width: 120px;
    text-align: center;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Cost Items Container */
.cost-items-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.cost-column {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.column-title {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

/* Collapsible sections - works in all views */
.collapsible-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.collapsible-title .title-text {
    flex: 1;
}

.chevron-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    margin-left: 10px;
    display: inline-block;
}

.cost-column.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.cost-column:not(.collapsed) .chevron-icon {
    transform: rotate(0deg);
}

.cost-column.collapsed .cost-items {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.cost-column.collapsed .column-description {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
}

/* Keep column-total-card visible even when collapsed */
.cost-column.collapsed .column-total-card {
    opacity: 1;
    max-height: none;
    overflow: visible;
}

.cost-column:not(.collapsed) .cost-items {
    max-height: 5000px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.cost-column:not(.collapsed) .column-total-card {
    opacity: 1;
    max-height: none;
}

.cost-column:not(.collapsed) .column-description {
    max-height: 100px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.collapse-button {
    width: 100%;
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 0 0 10px 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0;
    display: none;
}

.cost-column:not(.collapsed) .collapse-button {
    display: block;
}

.cost-column.collapsed .collapse-button {
    display: none;
}

.collapse-button:hover {
    background: #5a6268;
}

.collapse-button:active {
    background: #495057;
}

.column-description {
    background: #f8f9fa;
    color: #6c757d;
    padding: 10px 20px;
    margin: 0;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

/* Cost Items */
.cost-items {
    overflow: hidden;
    flex: 1;
}

/* Column Total Cards */
.column-total-card {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    margin: 0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.2);
    border-top: 1px solid #e9ecef;
}

.total-card-content {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 600;
}

.total-label {
    font-size: 0.9rem;
    opacity: 0.95;
}

.total-amount {
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cost-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f4;
    gap: 15px;
    transition: background-color 0.2s ease;
}

.cost-item:last-child {
    border-bottom: none;
}

.cost-item:hover {
    background-color: #f8f9fa;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.item-unit {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

.item-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cost-input, .quantity-input {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 80px;
    text-align: center;
}

.cost-input:focus, .quantity-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.item-total {
    font-weight: 600;
    color: #27ae60;
    font-size: 1rem;
    min-width: 100px;
    text-align: right;
}

/* Calculator Summary */
.calculator-summary {
    position: sticky;
    top: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

.summary-card h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.summary-card h5 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

.summary-section {
    margin-bottom: 20px;
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item span:first-child {
    font-weight: 500;
    opacity: 0.9;
}

.summary-item span:last-child {
    font-weight: 700;
    font-size: 1.1rem;
}

.total-cost {
    color: #f1c40f !important;
    font-size: 1.3rem !important;
}

/* Instructions Section */
.instructions-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.instruction-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.instruction-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.instruction-card p {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Calculator Responsive Design */
@media (max-width: 1024px) {
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .calculator-summary {
        position: static;
    }
    
    .cost-items-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .cost-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .item-inputs {
        justify-content: center;
    }
    
    .item-total {
        text-align: center;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .input-group input {
        width: 100%;
    }
    
    .cost-items-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .column-title {
        font-size: 1.1rem;
        padding: 12px 15px;
    }
    
    .column-description {
        font-size: 0.85rem;
        padding: 8px 15px;
    }
    
    .column-total-card {
        margin: 0;
    }
    
    .total-card-content {
        padding: 12px 15px;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .total-label {
        font-size: 0.8rem;
    }
    
    .total-amount {
        font-size: 1.1rem;
    }
    
    /* Mobile-specific adjustments for collapsible sections */
    .chevron-icon {
        font-size: 0.85rem;
    }
    
    .collapse-button {
        font-size: 0.85rem;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .calculator-section,
    .instructions-section {
        padding: 20px;
    }
    
    .cost-input, .quantity-input {
        width: 70px;
        font-size: 0.85rem;
    }
    
    .summary-card {
        padding: 20px;
    }
}

/* Quick Reference Table - Subtle styling for quick reference only */
.quick-reference-table {
    margin-top: 20px;
    margin-bottom: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    order: 3;
}

.quick-ref-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
}

.quick-reference-table:hover {
    opacity: 0.9;
}

.quick-reference-table table {
    width: 100%;
    border-collapse: collapse;
    background: #f9f9f9;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.85rem;
}

.quick-reference-table thead {
    background: #e8e8e8;
}

.quick-reference-table th {
    padding: 8px 12px;
    text-align: center;
    font-weight: 500;
    color: #666;
    font-size: 0.8rem;
    border-bottom: 1px solid #ddd;
}

.quick-reference-table td {
    padding: 8px 12px;
    text-align: center;
    color: #555;
    border-bottom: 1px solid #e8e8e8;
}

.quick-reference-table tbody tr:last-child td {
    border-bottom: none;
}

