/* ============================================
   QUICKCALC PRO - CALCULATOR PAGES CSS
   Centralized styling for all calculator pages
   ============================================ */

/* Base styles - inherit from main style.css */
/* Assumes style.css is loaded first with: body, .container, header, footer */

/* Header extensions for calculator pages */
header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main content */
main {
    padding: 3rem 0;
}

/* Back link styling */
.back-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Logo styling for calculator pages */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.logo svg {
    height: 50px;
    width: auto;
}

.page-title {
    text-align: left;
}

.page-title h1 {
    font-size: 1.8rem;
    margin: 0;
    color: white;
}

.page-title p {
    font-size: 1rem;
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    color: white;
}

/* Tab Container System */
.tab-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tab-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-wrap: wrap;
}

.tab-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Calculator Grid System */
.calculator-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.input-group input, 
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: white;
}

.input-group input:focus, 
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Input Row for side-by-side inputs */
.input-row {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.input-container {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

/* Buttons */
.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 100%;
    margin-top: 1rem;
}

.calculate-btn:hover {
    transform: translateY(-1px);
}

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

/* Results */
.result {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    display: none;
}

.result.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Result Metrics Display */
.metrics-display {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin: 1rem 0;
}

.metric-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.metric-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Formula Info Boxes */
.formula-info {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #FFC107;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 10px 10px 0;
}

/* Materials List (for construction calculators) */
.materials-list {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.materials-list h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.materials-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

/* Info Sections */
.info-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.info-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.info-section h4 {
    color: #2c3e50;
    margin: 1rem 0 0.5rem 0;
    font-size: 1.2rem;
}

.info-section ul {
    margin-left: 1.5rem;
    color: #7f8c8d;
}

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

.info-section p {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

/* Footer - inherits from main style.css */

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .container { padding: 0 15px; }
    
    header h1 { font-size: 2rem; }
    
    main { padding: 2rem 0; }
    
    .logo {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .logo svg {
        height: 40px;
    }
    
    .page-title {
        text-align: center;
    }
    
    .tab-nav { flex-direction: column; }
    
    .tab-button { 
        padding: 0.75rem 1rem;
        min-width: auto;
    }
    
    .tab-content { padding: 1.5rem; }
    
    .calculator-grid { gap: 1rem; }
    
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5 {
        grid-template-columns: 1fr;
    }
    
    .input-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .metrics-display {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .metric-card {
        padding: 0.75rem;
    }
    
    .metric-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    header { padding: 1.5rem 0; }
    
    main { padding: 1.5rem 0; }
    
    .tab-content { padding: 1rem; }
    
    .info-section { padding: 1.5rem; }
    
    .calculate-btn {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .input-group input,
    .input-group select {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .back-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Margin utilities */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* Visibility utilities */
.hidden { display: none; }
.visible { display: block; }

/* Color utilities */
.text-muted { color: #7f8c8d; }
.text-primary { color: #2c3e50; }
.text-accent { color: #667eea; }