/* Common CSS for Gas Law Calculators */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Theme Colors */
.ideal-theme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.relative-theme {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.real-theme {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.calculator {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 30px;
    max-width: 600px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 5px;
}

.header .formula {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.header .brand {
    color: #999;
    font-size: 12px;
    margin-top: 10px;
}

/* Theme-specific formula colors */
.ideal-theme .formula { color: #667eea; }
.relative-theme .formula { color: #ff6b6b; }
.real-theme .formula { color: #11998e; }

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: #333;
    font-weight: bold;
    margin-bottom: 5px;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

/* Theme-specific focus colors */
.ideal-theme .input-group input:focus,
.ideal-theme .input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.relative-theme .input-group input:focus,
.relative-theme .input-group select:focus {
    outline: none;
    border-color: #ff6b6b;
}

.real-theme .input-group input:focus,
.real-theme .input-group select:focus {
    outline: none;
    border-color: #11998e;
}

/* Solve-for dropdown styling */
.solve-for {
    font-weight: bold !important;
}

.ideal-theme .solve-for {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border: 2px solid #667eea !important;
}

.relative-theme .solve-for {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
    color: white !important;
    border: 2px solid #ff6b6b !important;
}

.real-theme .solve-for {
    background: linear-gradient(135deg, #11998e, #38ef7d) !important;
    color: white !important;
    border: 2px solid #11998e !important;
}

.solve-for option {
    background: white;
    color: #333;
}

/* Calculate button */
.calculate-btn {
    width: 100%;
    padding: 15px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    margin: 20px 0;
}

.ideal-theme .calculate-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.relative-theme .calculate-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.real-theme .calculate-btn {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

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

/* Results */
.result {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid;
    margin-top: 20px;
    display: none;
}

.ideal-theme .result { border-left-color: #667eea; }
.relative-theme .result { border-left-color: #ff6b6b; }
.real-theme .result { border-left-color: #11998e; }

.result.show {
    display: block;
}

.result h3 {
    color: #333;
    margin-bottom: 10px;
}

.result .value {
    font-size: 24px;
    font-weight: bold;
}

.ideal-theme .result .value { color: #667eea; }
.relative-theme .result .value { color: #ff6b6b; }
.real-theme .result .value { color: #11998e; }

.units {
    color: #666;
    font-size: 14px;
    margin-left: 5px;
}

.error {
    background: #ffe6e6 !important;
    border-left-color: #ff4444 !important;
}

.error .value {
    color: #ff4444 !important;
}

/* Conditions container for relative calculator */
.conditions-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.condition-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-top: 4px solid;
}

.relative-theme .condition-group {
    border-top-color: #ff6b6b;
}

.condition-group h3 {
    margin-bottom: 15px;
    text-align: center;
    font-size: 16px;
}

.relative-theme .condition-group h3 {
    color: #ff6b6b;
}

.condition-group .input-group {
    margin-bottom: 15px;
}

.condition-group .input-group label {
    font-size: 14px;
}

.condition-group .input-group input {
    padding: 10px;
    font-size: 14px;
    border-radius: 6px;
}

/* Notes */
.note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #856404;
}

/* Real gas specific styles */
.constants-section {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #11998e;
}

.constants-section h4 {
    color: #11998e;
    margin-bottom: 10px;
}

.constants-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Responsive design */
@media (max-width: 768px) {
    .conditions-container,
    .constants-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header .formula {
        font-size: 16px;
    }
}