/* Hyttekos - Modern Clean Cabin Styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #2c3e50;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Header Styling */
.cabin-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px 0;
    margin-bottom: 30px;
    border-radius: 0 0 25px 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}


.cabin-title {
    text-align: center;
    font-size: 2.8rem;
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.cabin-subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
}


/* Main Content */
.main-content {
    padding: 0 0 100px 0;
}

/* Dashboard Layout */
#dashboard {
    margin-bottom: 30px;
}

.temperature-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}


.temperature-card .card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* Thermometer Icon */
.thermometer-icon {
    width: 60px;
    height: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thermometer-bulb {
    width: 18px;
    height: 18px;
    background: #e74c3c;
    border-radius: 50%;
    position: absolute;
    bottom: 5px;
    z-index: 2;
    animation: temperaturePulse 2s ease-in-out infinite;
}

.thermometer-tube {
    width: 8px;
    height: 35px;
    background: #e74c3c;
    border-radius: 4px 4px 0 0;
    position: absolute;
    top: 10px;
    opacity: 0.9;
}

.degree-symbol {
    position: absolute;
    top: 8px;
    right: 5px;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
}

@keyframes temperaturePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.temperature-info h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.4rem;
    font-weight: 600;
}

.temperature-reading {
    font-size: 3rem;
    color: #e74c3c;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Control Cards */
.control-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.control-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.control-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.control-card .card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

/* Fire Icon for Heating */
.fire-icon {
    width: 60px;
    height: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff7f32, #e85a00);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(255, 127, 50, 0.3);
}

.flame {
    position: absolute;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 1.5s ease-in-out infinite alternate;
}

.flame1 {
    width: 18px;
    height: 28px;
    background: white;
    left: 21px;
    animation-delay: 0s;
}

.flame2 {
    width: 12px;
    height: 22px;
    background: rgba(255, 255, 255, 0.8);
    left: 24px;
    top: 3px;
    animation-delay: 0.3s;
}

.flame3 {
    width: 6px;
    height: 12px;
    background: rgba(255, 255, 255, 0.6);
    left: 27px;
    top: 8px;
    animation-delay: 0.6s;
}

@keyframes flicker {
    0% { transform: scale(1) rotate(-1deg); }
    100% { transform: scale(1.05) rotate(1deg); }
}

/* Water Drop Icon */
.water-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7fa68a, #5a7c65);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(127, 166, 138, 0.3);
}

.water-drop {
    width: 18px;
    height: 28px;
    background: white;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    animation: waterDrop 2s ease-in-out infinite;
}

.water-shine {
    width: 5px;
    height: 7px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    position: absolute;
    top: 7px;
    left: 4px;
}

@keyframes waterDrop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.control-info h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Toggle Slider */
.card-body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.toggle-label {
    color: #7f8c8d;
    font-size: 1rem;
    font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #bdc3c7;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    outline: none;
}

.toggle-switch.enabled {
    background: #ff7f32;
}

.toggle-switch.disabled {
    background: #bdc3c7;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    will-change: transform;
}

.toggle-switch.enabled::after {
    transform: translateX(30px);
}

.toggle-switch:hover {
    transform: scale(1.02);
    transition: transform 0.1s ease;
}

.toggle-switch:active::after {
    width: 28px;
    transition: width 0.1s ease;
}

/* Status Bar */
.status-bar {
    background: rgba(62, 39, 35, 0.95);
    border: 1px solid #6D4C41;
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    backdrop-filter: blur(5px);
    margin-bottom: 20px;
}

.connection-status,
.sensor-status,
.last-sync {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #FFE4B5;
}

.status-indicator.online {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Footer */
.cabin-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px 0;
    text-align: center;
    border-radius: 25px 25px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.cabin-footer p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0;
    padding-left: 20px;
}

.logout-btn {
    background: #7fa68a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    margin-right: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.logout-btn:hover {
    background: #5a7c65;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(127, 166, 138, 0.3);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #BCAAA4;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 127, 50, 0.3);
    border-top: 3px solid #ff7f32;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Error States */
.error-container {
    text-align: center;
    padding: 40px;
    background: rgba(74, 44, 42, 0.95);
    border: 2px solid #8D6E63;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.error-fragment {
    text-align: center;
    padding: 20px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid #F44336;
    border-radius: 10px;
    color: #FFCDD2;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.error-message {
    color: #FFCDD2;
    margin-bottom: 15px;
}

.retry-button {
    background: #FF5722;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button.small {
    padding: 5px 15px;
    font-size: 0.8rem;
}

.retry-button:hover {
    background: #FF8A50;
    transform: translateY(-1px);
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .cabin-title {
        font-size: 2rem;
    }
    
    .current-time {
        position: static;
        margin: 15px auto 0;
        display: inline-block;
    }
    
    .control-cards {
        grid-template-columns: 1fr;
    }
    
    .status-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .cabin-footer {
        flex-direction: column;
        gap: 10px;
        padding: 15px 0;
    }
    
    .cabin-footer p {
        padding: 0;
    }
    
    .logout-btn {
        margin: 0;
    }
    
    .main-content {
        padding-bottom: 120px;
    }
}