/* Room Environment Optimizer Specific Styles */

/* Environment Analysis Display */
.environment-analysis {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    border: 2px solid #10b981;
}

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

.environment-title {
    font-size: 20px;
    font-weight: 600;
    color: #059669;
    margin-bottom: 8px;
}

.environment-subtitle {
    font-size: 14px;
    color: #064e3b;
}

.environment-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.environment-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    text-align: center;
    transition: all 0.3s ease;
}

.environment-card:hover {
    border-color: #10b981;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

.environment-card.optimal {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.environment-card.good {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.environment-card.fair {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fefbf3, #fef3c7);
}

.environment-card.poor {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.lighting-assessment {
    margin-top: 20px;
}

.lighting-assessment h4 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.light-sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.light-source-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.light-source-item:hover {
    border-color: #f59e0b;
    background: #fef3c7;
}

.light-source-item input[type="checkbox"] {
    display: none;
}

.light-source-item input[type="checkbox"]:checked + .checkmark {
    background: #f59e0b;
    border-color: #f59e0b;
}

.light-source-item input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

.light-source-item:has(input[type="checkbox"]:checked) {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.light-source-item .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.light-source-item .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.source-details {
    flex: 1;
}

.source-details strong {
    display: block;
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.source-details span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.air-quality-factors {
    margin-top: 20px;
}

.air-quality-factors h4 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.factors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.factor-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.factor-item:hover {
    border-color: #ef4444;
    background: #fef2f2;
}

.factor-item input[type="checkbox"] {
    display: none;
}

.factor-item input[type="checkbox"]:checked + .checkmark {
    background: #ef4444;
    border-color: #ef4444;
}

.factor-item input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

.factor-item:has(input[type="checkbox"]:checked) {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.factor-item .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.factor-item .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.factor-details {
    flex: 1;
}

.factor-details strong {
    display: block;
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.factor-details span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.environment-overview {
    margin-bottom: 32px;
}

.environment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.environment-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.environment-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.environment-card.optimal {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.environment-card.good {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
}

.environment-card.needs-improvement {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.environment-card.poor {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.environment-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.environment-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Roboto Mono', monospace;
}

.environment-card.optimal .environment-value {
    color: #065f46;
}

.environment-card.good .environment-value {
    color: #1e40af;
}

.environment-card.needs-improvement .environment-value {
    color: #92400e;
}

.environment-card.poor .environment-value {
    color: #dc2626;
}

.environment-description {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.factor-analysis {
    margin: 32px 0;
}

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

.factor-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.factor-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.factor-card.optimal {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.factor-card.good {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
}

.factor-card.needs-improvement {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.factor-card.poor {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.factor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.factor-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.factor-card.optimal .factor-icon {
    background: #10b981;
}

.factor-card.good .factor-icon {
    background: #2563eb;
}

.factor-card.needs-improvement .factor-icon {
    background: #f59e0b;
}

.factor-card.poor .factor-icon {
    background: #ef4444;
}

.factor-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.factor-score {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Roboto Mono', monospace;
}

.factor-card.optimal .factor-score {
    color: #065f46;
}

.factor-card.good .factor-score {
    color: #1e40af;
}

.factor-card.needs-improvement .factor-score {
    color: #92400e;
}

.factor-card.poor .factor-score {
    color: #dc2626;
}

.factor-description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.optimization-recommendations {
    margin: 32px 0;
}

.optimization-list {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.optimization-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.optimization-item:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.optimization-item.high-priority {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.optimization-item.medium-priority {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.optimization-item.low-priority {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.optimization-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.optimization-priority {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.optimization-item.high-priority .optimization-priority {
    background: #ef4444;
    color: white;
}

.optimization-item.medium-priority .optimization-priority {
    background: #f59e0b;
    color: white;
}

.optimization-item.low-priority .optimization-priority {
    background: #10b981;
    color: white;
}

.optimization-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.optimization-description {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.optimization-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.optimization-action {
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.optimization-action:hover {
    background: #e2e8f0;
    border-color: #2563eb;
    color: #2563eb;
}

.sleep-impact-forecast {
    margin: 32px 0;
}

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

.forecast-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.forecast-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.forecast-card.positive {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.forecast-card.neutral {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
}

.forecast-card.negative {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.forecast-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.forecast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.forecast-card.positive .forecast-icon {
    background: #10b981;
}

.forecast-card.neutral .forecast-icon {
    background: #2563eb;
}

.forecast-card.negative .forecast-icon {
    background: #f59e0b;
}

.forecast-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.forecast-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Roboto Mono', monospace;
}

.forecast-card.positive .forecast-value {
    color: #065f46;
}

.forecast-card.neutral .forecast-value {
    color: #1e40af;
}

.forecast-card.negative .forecast-value {
    color: #92400e;
}

.forecast-description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.optimal-ranges {
    space-y: 12px;
}

.range-item {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 12px;
}

.range-item.temperature {
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
    border-color: #2563eb;
}

.range-item.humidity {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border-color: #10b981;
}

.range-item.darkness {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-color: #6b7280;
}

.range-item.air-quality {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}

.range-item strong {
    display: block;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.range-item span {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    font-family: 'Roboto Mono', monospace;
}

.range-item.temperature span {
    color: #1e40af;
}

.range-item.humidity span {
    color: #065f46;
}

.range-item.darkness span {
    color: #374151;
}

.range-item.air-quality span {
    color: #92400e;
}

.range-item small {
    color: #64748b;
    font-size: 12px;
}

.improvement-tips {
    space-y: 12px;
}

.tip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.tip-action {
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.tip-benefit {
    font-weight: 600;
    color: #2563eb;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .light-sources-grid {
        grid-template-columns: 1fr;
    }
    
    .factors-grid {
        grid-template-columns: 1fr;
    }
    
    .environment-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .factor-breakdown {
        grid-template-columns: 1fr;
    }
    
    .impact-forecast {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .environment-summary {
        grid-template-columns: 1fr;
    }
    
    .optimization-actions {
        flex-direction: column;
    }
    
    .tip-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Animation for environment reveal */
@keyframes environmentReveal {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.environment-card.animate {
    animation: environmentReveal 0.6s ease-out;
}

/* Loading states */
.factor-breakdown.loading {
    opacity: 0.6;
    pointer-events: none;
}

.factor-breakdown.loading::after {
    content: "Analyzing environment factors...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 500;
    color: #374151;
}
