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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Input Section */
.input-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

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

.input-group h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3748;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.dimension-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.input-field {
    display: flex;
    flex-direction: column;
}

.input-field label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 0.9rem;
}

.input-field input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.input-field input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Furniture Section */
.furniture-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3748;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.furniture-grid {
    display: grid;
    gap: 25px;
}

.furniture-item {
    background: #f8fafc;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.furniture-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #4a5568;
    display: flex;
    align-items: center;
}

.furniture-item h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #667eea;
    margin-right: 10px;
    border-radius: 2px;
}

.furniture-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

/* Layout Options */
.layout-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
    transition: color 0.3s ease;
}

.checkbox-label:hover {
    color: #667eea;
}

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

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 5px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

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

.calculate-btn i {
    margin-right: 10px;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.results-header {
    margin-bottom: 30px;
}

.results-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3748;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.room-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.info-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.info-item .label {
    font-weight: 500;
    color: #4a5568;
    display: block;
    margin-bottom: 5px;
}

.info-item .value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

/* Furniture Results */
.furniture-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.result-icon {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.result-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #4a5568;
}

.result-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.result-details {
    font-size: 0.9rem;
    color: #718096;
}

/* Visual Layout */
.visual-layout h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.layout-container {
    background: #f8fafc;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

#layoutCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    background: white;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.layout-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #4a5568;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #cbd5e0;
}

.desk-color {
    background: #4299e1;
}

.chair-color {
    background: #48bb78;
}

.aisle-color {
    background: #ed8936;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .container {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .input-section,
    .results-section {
        padding: 20px;
    }
    
    .dimension-inputs,
    .furniture-inputs {
        grid-template-columns: 1fr;
    }
    
    .room-info {
        grid-template-columns: 1fr;
    }
    
    .furniture-results {
        grid-template-columns: 1fr;
    }
    
    .layout-legend {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .input-section,
    .results-section {
        padding: 15px;
    }
    
    .calculate-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-section,
.results-section {
    animation: fadeInUp 0.6s ease-out;
}

.result-card {
    animation: fadeInUp 0.6s ease-out;
    animation-delay: calc(var(--animation-order) * 0.1s);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* Focus States for Accessibility */
input:focus,
button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading States */
.calculating {
    opacity: 0.7;
    pointer-events: none;
}

.calculating .calculate-btn {
    background: #a0aec0;
    cursor: not-allowed;
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.success {
    animation: successPulse 0.6s ease-in-out;
}
