* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --primary-light: #BBDEFB;
    --accent-color: #FF4081;
    --text-color: #333;
    --text-light: #757575;
    --background-color: #F5F5F5;
    --surface-color: #FFF;
    --error-color: #F44336;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --info-color: #2196F3;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: var(--surface-color);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow-y: auto;
}

.logo {
    padding: 20px;
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
}

.logo i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.nav-menu li:hover {
    background-color: #f0f7ff;
    border-left-color: var(--primary-light);
}

.nav-menu li.active {
    background-color: #e3f2fd;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-menu li i {
    margin-right: 10px;
    font-size: 1.1rem;
    color: inherit;
}

.user-profile {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-top: 1px solid #eee;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--background-color);
}

.top-bar {
    background: var(--surface-color);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 5;
}

.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.ai-assistant {
    margin: 0 30px;
}

.ai-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.ai-button:hover {
    background-color: var(--primary-dark);
}

.ai-button i {
    margin-right: 8px;
}

.top-controls {
    display: flex;
    align-items: center;
}

.notification-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-color);
    cursor: pointer;
    position: relative;
    margin-right: 15px;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.language-selector select {
    border: 1px solid #e0e0e0;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    outline: none;
    cursor: pointer;
}

/* Dashboard Content */
.dashboard {
    padding: 20px 30px;
    flex: 1;
    overflow-y: auto;
}

.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.welcome-text h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

.welcome-text p {
    color: var(--text-light);
}

.weather-widget {
    background: var(--surface-color);
    padding: 15px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    box-shadow: var(--box-shadow);
}

.current-weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 20px;
}

.current-weather i {
    font-size: 2rem;
    color: var(--warning-color);
    margin-bottom: 5px;
}

.temperature {
    font-size: 1.5rem;
    font-weight: 600;
}

.weather-info p {
    margin: 2px 0;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    box-shadow: var(--box-shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
}

.energy-icon {
    background-color: #ffe0b2;
    color: #ff9800;
}

.comfort-icon {
    background-color: #c8e6c9;
    color: #4caf50;
}

.security-icon {
    background-color: #bbdefb;
    color: #2196f3;
}

.economy-icon {
    background-color: #e1bee7;
    color: #9c27b0;
}

.stat-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-info p {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.trend.increase {
    color: var(--success-color);
}

.trend.decrease {
    color: var(--error-color);
}

.status {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
}

.status.ok {
    background-color: #e8f5e9;
    color: var(--success-color);
}

.status.warning {
    background-color: #fff8e1;
    color: var(--warning-color);
}

/* Room Control Section */
.room-control-section, 
.usage-analysis,
.ai-learning-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 500;
}

.add-room-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    transition: var(--transition);
}

.add-room-btn:hover {
    background-color: var(--primary-dark);
}

.add-room-btn i {
    margin-right: 5px;
}

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

.room-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.room-header h3 {
    font-size: 1.2rem;
    font-weight: 500;
}

.room-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
}

.room-status.active {
    background-color: #e8f5e9;
    color: var(--success-color);
}

.room-status.inactive {
    background-color: #f5f5f5;
    color: var(--text-light);
}

.room-controls {
    margin-bottom: 15px;
}

.control-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.control-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.control-item i {
    margin-right: 8px;
    width: 20px;
    color: var(--primary-color);
}

.control-info {
    display: inline-block;
    margin-bottom: 5px;
}

.slider {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    outline: none;
    border-radius: 5px;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.toggle-switch {
    width: 40px;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

.toggle-switch.on {
    background-color: var(--primary-light);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.on::after {
    left: calc(100% - 18px);
    background-color: var(--primary-color);
}

.ai-suggestion {
    background-color: #e3f2fd;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: flex-start;
    font-size: 0.9rem;
}

.ai-suggestion.warning {
    background-color: #fff8e1;
}

.ai-suggestion i {
    margin-right: 10px;
    font-size: 1rem;
    color: var(--primary-color);
    margin-top: 2px;
}

.ai-suggestion.warning i {
    color: var(--warning-color);
}

/* Chart Styles */
.period-selector {
    display: flex;
}

.period-btn {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.period-btn:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.period-btn:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.period-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-container {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.chart {
    height: 200px;
    margin-bottom: 20px;
}

.chart-bars {
    display: flex;
    height: 100%;
    align-items: flex-end;
    justify-content: space-between;
    padding-top: 30px;
    position: relative;
}

.chart-label {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

.chart-bar {
    flex: 1;
    margin: 0 5px;
    background-color: #bbdefb;
    position: relative;
    border-radius: 3px 3px 0 0;
    transition: var(--transition);
}

.chart-bar.active {
    background-color: var(--primary-color);
}

.chart-bar.predicted {
    background-color: #c8e6c9;
}

.chart-bar span {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-light);
}

.legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 0 15px;
    font-size: 0.9rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 5px;
}

.legend-color.actual {
    background-color: var(--primary-color);
}

.legend-color.predicted {
    background-color: #4caf50;
}

.legend-color.optimized {
    background-color: #ff9800;
}

.optimization-suggestions {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.optimization-suggestions h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.suggestions-list {
    list-style: none;
    margin-bottom: 20px;
}

.suggestions-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.suggestions-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.suggestions-list li i {
    color: var(--primary-color);
    margin-right: 10px;
    margin-top: 2px;
}

.apply-all-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 20px;
    width: 100%;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.apply-all-btn:hover {
    background-color: #388e3c;
}

/* AI Learning Section */
.learning-progress {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.learning-item {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: var(--box-shadow);
}

.learning-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.learning-info {
    flex: 1;
}

.learning-info h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    margin-bottom: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
}

.learning-info span {
    font-size: 0.9rem;
    color: var(--text-light);
}

.scene-creation h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.scenes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.scene-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--box-shadow);
    position: relative;
}

.scene-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--primary-color);
}

.scene-details h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.scene-details p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.scene-devices {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.edit-scene-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
}

.add-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e0e0e0;
    background-color: #fafafa;
    color: var(--text-light);
    cursor: pointer;
    height: 100%;
    min-height: 124px;
}

.add-scene-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 1rem;
}

/* Voice Assistant Overlay */
.voice-assistant-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.voice-assistant-overlay.hidden {
    display: none;
}

.voice-assistant-dialog {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    width: 400px;
    max-width: 90%;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.voice-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary-color);
    color: white;
}

.close-dialog-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.voice-visualization {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    height: 80px;
}

.wave {
    width: 5px;
    height: 30px;
    background-color: var(--primary-light);
    margin: 0 3px;
    border-radius: 5px;
    animation: wave 1.5s infinite ease-in-out;
}

.wave.active {
    background-color: var(--primary-color);
    height: 50px;
}

@keyframes wave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 40px;
    }
}

.wave:nth-child(1) {
    animation-delay: 0.1s;
}

.wave:nth-child(2) {
    animation-delay: 0.2s;
}

.wave:nth-child(3) {
    animation-delay: 0.3s;
}

.wave:nth-child(4) {
    animation-delay: 0.4s;
}

.wave:nth-child(5) {
    animation-delay: 0.5s;
}

.assistant-message {
    padding: 0 20px 20px;
    text-align: center;
}

.voice-suggestions {
    padding: 0 20px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.suggestion-chip {
    background-color: #f5f5f5;
    padding: 8px 12px;
    border-radius: 16px;
    margin: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-chip:hover {
    background-color: #e0e0e0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        padding: 10px;
    }
    
    .logo {
        border-bottom: none;
        padding: 10px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .user-profile {
        display: none;
    }
    
    .top-bar {
        padding: 10px 15px;
    }
    
    .search-container {
        max-width: 200px;
    }
    
    .ai-assistant {
        margin: 0 10px;
    }
    
    .dashboard {
        padding: 15px;
    }
    
    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .weather-widget {
        margin-top: 15px;
        width: 100%;
    }
    
    .quick-stats, 
    .rooms-grid,
    .learning-progress {
        grid-template-columns: 1fr;
    }
}
