/* Mental Health House - Main CSS */
/* Color Palette: Sage Green (#9CAF88), French Blue (#6699CC), Ivory (#FFFFF0) */

:root {
    --sage-green: #9CAF88;
    --french-blue: #6699CC;
    --ivory: #FFFFF0;
    --text-dark: #2d3748;
    --text-light: #718096;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--ivory);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Navigation Styles */
.nav-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--ivory);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--ivory);
    color: var(--sage-green);
    border-color: var(--ivory);
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-btn:hover::before {
    left: 100%;
}

/* Room Styles */
.room {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-slow);
    min-height: 60vh;
}

.room.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.room-header {
    text-align: center;
    margin-bottom: 2rem;
}

.room-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* House Container */
.house-container {
    position: relative;
    background: linear-gradient(135deg, var(--sage-green), var(--french-blue));
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 10px 30px var(--shadow-medium);
    overflow: hidden;
}

.house-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

/* Room Buttons */
.room-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    padding: 2rem;
}

.room-button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--shadow-light);
}

.room-button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.room-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.room-button:hover::before {
    transform: translateX(100%);
}

.room-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    z-index: 1;
    position: relative;
}

/* Canvas Styles */
canvas {
    border-radius: 0.5rem;
    box-shadow: 0 4px 15px var(--shadow-light);
    background: var(--ivory);
    display: block;
    max-width: 100%;
    height: auto;
}

/* Info Panel */
.info-panel {
    background: var(--ivory);
    border: 1px solid rgba(156, 175, 136, 0.2);
    transition: var(--transition-smooth);
}

.info-panel:hover {
    box-shadow: 0 8px 25px var(--shadow-light);
    transform: translateY(-2px);
}

/* Content Warning Modal */
#contentWarning {
    backdrop-filter: blur(5px);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#contentWarning .bg-ivory {
    animation: slideUp 0.5s ease-out 0.2s both;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .room-buttons {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .room-button {
        min-height: 100px;
        padding: 1rem;
    }
    
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .room-buttons {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 1fr);
    }
    
    .nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    h1 {
        font-size: 2rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
button:focus,
.nav-btn:focus,
.room-button:focus {
    outline: 2px solid var(--french-blue);
    outline-offset: 2px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--sage-green);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Styles */
::selection {
    background: var(--sage-green);
    color: var(--ivory);
}

::-moz-selection {
    background: var(--sage-green);
    color: var(--ivory);
}