/* dashboard.css - Family Edition - Kompakt nettbrettversjon */
/* ============================================
   WEB APP FULLSKJERM STØTTE
   ============================================ */

html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.dashboard-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: row;
    background: #e3f2fd;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

/* iOS Safe Area support (for notch/home indicator) */
@supports (padding: max(0px)) {
    .dashboard-container {
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Prevent overscroll/bounce effect på iOS */
.dashboard-main,
.sidebar {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Hindre zoom på double-tap */
button,
input,
select {
    touch-action: manipulation;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #e3f2fd;
    color: #2c2c2c;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* ============================================
   MAIN CONTENT AREA - KOMPRIMERT
   ============================================ */

.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 14px 1px 14px;
    gap: 11px;
    min-width: 0;
    overflow: hidden;
}

/* ============================================
   HEADER - Mindre og mer kompakt
   ============================================ */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c2c2c;
    letter-spacing: -0.5px;
}

.hue-button,
.power-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.hue-button {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.3);
}

.power-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.hue-button:hover,
.power-button:hover {
    transform: scale(1.08);
}

.hue-button:active,
.power-button:active {
    transform: scale(1.02);
}

.header-right {
    display: flex;
    align-items: center;
}

.time-display {
    text-align: right;
}

.time-large {
    font-size: 3rem;
    font-weight: 700;
    color: #1976D2;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.date-text {
    font-size: 1rem;
    color: #757575;
    margin-top: 3px;
    font-weight: 500;
}

/* ============================================
   MAIN GRID - 3 Like Spalter - KOMPRIMERT
   ============================================ */

.dashboard-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

.widget-homework {
    grid-column: 1;
    grid-row: 1 / span 3; /* Tar 2 rader høyde */
}

.widget-dinner {
    grid-column: 2;
    grid-row: 1;
}

.widget-bedtime-ulrik {
    grid-column: 2;
    grid-row: 2;
}

.widget-bedtime-william {
    grid-column: 2;
    grid-row: 3;
}

.widget-calendar {
    grid-column: 3;
    grid-row: 1 / span 3; /* Tar 3 rader høyde */
}

/* ============================================
   WIDGET BASE STYLING - KOMPRIMERT
   ============================================ */

.widget {
    background: white;
    border-radius: 6px;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
}

.widget:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.widget-header {
    padding: 10px 14px;
    border-bottom: 2px solid #f0f0f0;
    flex-shrink: 0;
}

.widget-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.widget-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    min-height: 0;
}

/* Scrollbar styling */
.widget-content::-webkit-scrollbar {
    width: 6px;
}

.widget-content::-webkit-scrollbar-track {
    background: transparent;
}

.widget-content::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

.widget-content::-webkit-scrollbar-thumb:hover {
    background: #bdbdbd;
}

.loading-text {
    text-align: center;
    color: #9e9e9e;
    font-size: 0.85rem;
    padding: 15px;
}

/* ============================================
   WILLIAMS LEKSER - EKSTRA KOMPRIMERT
   ============================================ */

.homework-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: none;
}

.homework-header h2 {
    color: #F57C00;
}

.widget-homework .widget-content {
    background: rgba(255, 255, 255, 0.98);
    margin: 0;
    padding: 10px;
    border-radius: 0 0 6px 6px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.homework-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.homework-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: white;
    border-left: 3px solid #FF7043;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.homework-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 6px rgba(255, 112, 67, 0.2);
}

.homework-item.completed {
    opacity: 0.5;
    background: #f9f9f9;
}

.homework-item.completed .homework-description {
    text-decoration: line-through;
    color: #9e9e9e;
}

.homework-checkbox {
    width: 40px;  /* ENDRET: Fra 18px */
    height: 40px;  /* ENDRET: Fra 18px */
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #FF7043;
}

.homework-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    display: none; /* Skjul ikon for å spare plass */
}

.homework-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.homework-subject {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #F57C00;
}

.homework-description {
    font-size: 1.5rem;  /* ENDRET: Fra 1.2rem */
    color: #2c2c2c;
    line-height: 1.2;
    font-weight: 500;
}

.homework-description-week {
    font-size: 1rem;  /* ENDRET: Fra 1.2rem */
    color: #2c2c2c;
    line-height: 1.2;
    font-weight: 500;
}

.homework-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    color: #757575;
    margin-top: 2px;
}

.homework-date {
    font-size:1.2rem;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}

.homework-type-badge {
    background: #fff3e0;
    color: #f57c00;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
}

.homework-type-badge.weekly {
    background: #e8eaf6;
    color: #5c6bc0;
}

.homework-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #F57C00;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 10px 0 6px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #FFE0B2;
}

.homework-section-title:first-child {
    margin-top: 0;
}

.homework-empty {
    text-align: center;
    padding: 30px 12px;
}

.homework-empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.homework-empty div {
    font-size: 0.95rem;
    color: #F57C00;
    font-weight: 600;
}

/* Lenke i lekser */
.homework-link {
    margin-top: 8px;
}

.homework-link a {
    color: #2196F3;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.homework-link a:hover {
    text-decoration: underline;
}

/* Bilde i lekser */
.homework-image {
    margin-top: 12px;
}

.homework-image img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.homework-image img:hover {
    transform: scale(1.02);
}

/* Bildezoom modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 10001;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Middag Widget */
.widget-dinner {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.dinner-header {
    background: rgba(76, 175, 80, 0.15);
    /* Gammel: background: rgba(255, 255, 255, 0.15); */
    padding: 15px 20px;
    border-bottom: 2px solid rgba(76, 175, 80, 0.3);
    /* Gammel: border-bottom: 2px solid rgba(255, 255, 255, 0.2); */
}

.dinner-header h2 {
    color: #2E7D32;
    /* Gammel: color: white; */
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.dinner-content {
    padding: 30px 20px;
    text-align: center;
}

.dinner-menu {
    font-size: 2rem;
    font-weight: 800;
    color: #1B5E20;
    /* Gammel: color: white; */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Gammel: text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); */
    line-height: 1.4;
}

.dinner-empty,
.dinner-error {
    padding: 30px 20px;
    text-align: center;
    color: #2E7D32;
    /* Gammel: color: white; */
}

.dinner-empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.dinner-empty div:last-child,
.dinner-error div {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.8;
    /* Gammel: opacity: 0.9; */
}

/* Responsive for dinner widget */
@media (max-width: 768px) {
    .dinner-menu {
        font-size: 1.6rem;
    }
}

/* ============================================
   ULRIKS & WILLIAMS LEGGETID - KOMPRIMERT
   ============================================ */

.widget-bedtime {
    background: linear-gradient(135deg, #42A5F5 0%, #26C6DA 100%);
}

.widget-bedtime-william {
    background: linear-gradient(135deg, #FFA726 0%, #FF7043 100%);
}

.bedtime-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: none;
}

.bedtime-header h2 {
    color: #0277BD;
}

.bedtime-header-william {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: none;
}

.bedtime-header-william h2 {
    color: #F57C00;
}

.widget-bedtime .widget-content {
    background: rgba(255, 255, 255, 0.98);
    margin: 0;
    padding: 12px;
    border-radius: 0 0 6px 6px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.bedtime-widget {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    height: 100%;
}

.bedtime-person-photo {
    width: 160px;
    height: 160px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #0277BD;
    box-shadow: 0 3px 12px rgba(2, 119, 189, 0.3);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.bedtime-person-photo:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(2, 119, 189, 0.4);
}

.bedtime-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
}

.bedtime-message {
    font-size: 1.4rem;
    font-weight: 500;
    color: #757575;
    margin: 0;
    line-height: 1.2;
}

.bedtime-person-name {
    font-size: 3.5rem;
    font-weight: 800;
    color: #0277BD;
    margin: 4px 0;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(2, 119, 189, 0.2);
}

.bedtime-secondary {
    font-size: 1.4rem;
    color: #424242;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.bedtime-notes {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #e65100;
    max-width: 100%;
}

.bedtime-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 12px;
}

.bedtime-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.bedtime-empty-text {
    font-size: 0.9rem;
    color: #0277BD;
    font-weight: 600;
    text-align: center;
}

/* ============================================
   KALENDER - KOMPRIMERT
   ============================================ */

.widget-calendar {
    background: white;
}

.calendar-header {
    background: linear-gradient(135deg, #E1BEE7 0%, #CE93D8 100%);
    border-bottom: none;
}

.calendar-header h2 {
    color: white;
}

.calendar-day-section {
    margin-bottom: 12px;
}

.calendar-day-section:last-child {
    margin-bottom: 0;
}

.calendar-day-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: #7B1FA2;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid #f3e5f5;
}

.calendar-person-group {
    margin-bottom: 10px;
}

.calendar-person-group:last-child {
    margin-bottom: 0;
}

.calendar-person-header {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
    padding-left: 8px;
    border-left: 3px solid currentColor;
}

.calendar-event {
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: all 0.2s ease;
    border-left: 3px solid #e0e0e0;
    cursor: pointer;
}

.calendar-event:hover {
    background: #f3e5f5;
    transform: translateX(2px);
    border-left-color: #AB47BC;
}

.calendar-event:last-child {
    margin-bottom: 0;
}

.calendar-event.compact {
    padding: 6px 10px;
}

.calendar-event.generic {
    border-left-color: #9E9E9E;
    cursor: default;
}

.calendar-event.generic:hover {
    border-left-color: #757575;
    transform: none;
}

.calendar-event-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.calendar-event-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c2c2c;
    flex: 1;
}

.calendar-event-time {
    font-size: 0.7rem;
    font-weight: 600;
    color: #7B1FA2;
    white-space: nowrap;
}

.calendar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 12px 0;
}

.calendar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 30px 15px;
}

.calendar-empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.calendar-empty-text {
    font-size: 0.95rem;
    color: #7B1FA2;
    font-weight: 600;
    text-align: center;
}

/* ============================================
   WEATHER FOOTER - KOMPRIMERT
   ============================================ */

.weather-footer {
    height: 140px;
    background: white;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.weather-footer::-webkit-scrollbar {
    height: 5px;
}

.weather-footer::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.weather-footer::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 3px;
}

.weather-hour {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 55px;
    padding: 6px 5px;
    gap: 4px;
    background: #fafafa;
    border: 2px solid #f0f0f0;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.weather-hour:hover {
    background: white;
    border-color: #42A5F5;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(66, 165, 245, 0.15);
}

.weather-hour.current-hour {
    background: linear-gradient(135deg, #42A5F5 0%, #26C6DA 100%);
    border-color: #0277BD;
}

.weather-hour.current-hour .weather-time,
.weather-hour.current-hour .weather-temp {
    color: white;
}

.weather-time {
    font-size: 0.8rem;
    color: #424242;
    font-weight: 700;
}

.weather-icon {
    font-size: 2rem;
    margin: 2px 0;
}

.weather-temp {
    font-size: 1.1rem;
    color: #2c2c2c;
    font-weight: 700;
}

.weather-precipitation {
    display: none;
}

/* ============================================
   SIDEBAR - KOMPRIMERT
   ============================================ */

.sidebar {
    width: 220px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 10px;
    border-radius: 6px 0 0 6px;
    overflow: hidden;
}

.sidebar-section {
    background: white;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.sidebar-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #424242;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f0f0f0;
}

/* Garasje Section - KOMPRIMERT */
.garage-section {
    flex-shrink: 0;
}

.garage-widget-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.garage-status-circle {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.garage-status-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.garage-status-circle:active {
    transform: scale(0.98);
}

.garage-status-closed {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-color: #c62828;
}

.garage-status-open {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #388E3C;
}

.garage-status-opening,
.garage-status-closing {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    border-color: #E65100;
}

.garage-status-unavailable {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
    border-color: #616161;
    cursor: not-allowed;
}

.garage-status-opening .garage-icon,
.garage-status-closing .garage-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

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

.garage-icon {
    font-size: 2rem;
    margin-bottom: 3px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.garage-status-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.garage-control-info {
    text-align: center;
    color: #757575;
    font-size: 0.7rem;
}

.garage-last-changed {
    margin-top: 3px;
    font-size: 0.65rem;
    color: #9e9e9e;
    font-weight: 500;
}

.garage-status-circle.loading {
    pointer-events: none;
    opacity: 0.7;
}

.garage-status-circle.loading .garage-icon {
    animation: spin 1s linear infinite;
}

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

/* Temperature Section - EKSTRA KOMPRIMERT */
.temp-section {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.temp-section::-webkit-scrollbar {
    width: 4px;
}

.temp-section::-webkit-scrollbar-track {
    background: transparent;
}

.temp-section::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 2px;
}

.temp-section::-webkit-scrollbar-thumb:hover {
    background: #bdbdbd;
}

.temp-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.temp-item {
    display: flex;
    flex-direction: column;
    padding: 5px 6px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.temp-item:hover {
    background: white;
    border-color: #42A5F5;
    transform: translateX(-2px);
}

.temp-icon {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.temp-location {
    font-size: 1.2rem;
    color: #757575;
    margin-bottom: 3px;
    font-weight: 600;
}

.temp-value {
    font-size: 3rem;
    font-weight: 800;
    color: #424242;
    margin: 2px 0;
    word-break: break-word;
}

.temp-humidity {
    font-size: 0.65rem;
    color: #2196F3;
    margin: 2px 0;
    font-weight: 600;
}

.temp-source {
    display: none; /* Skjul kilde for å spare plass */
}

/* Renovasjon Section - KOMPRIMERT */
.renovation-section {
    flex-shrink: 0;
    margin-top: 8px;
}

.renovation-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: linear-gradient(135deg, #4134138c 0%, #8f7637a3 69%);
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s ease;
}

.renovation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.renovation-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.renovation-type {
    font-size: 1rem;
    color: white;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.renovation-date {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* ========================================
   DOORBELL OVERLAY - FULLSKJERM
   ======================================== */

.doorbell-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.doorbell-overlay.active {
    display: flex;
}

/* Alert box fyller hele skjermen */
.doorbell-alert-box {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Video/bilde fyller hele skjermen */
.doorbell-alert-video {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

.doorbell-alert-stream {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Stopp-knapp øverst til høyre - KUN synlig ved ringing */
.doorbell-stop-button {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 32px 48px;  /* ENDRET: Fra 16px 24px */
    background: rgba(244, 67, 54, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    border: none;
    border-radius: 16px;  /* ENDRET: Fra 12px */
    font-size: 2.4rem;  /* ENDRET: Fra 1.2rem */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.doorbell-stop-button:hover,
.doorbell-stop-button:active {
    background: rgba(211, 47, 47, 0.95);
    transform: scale(0.98);
}

/* Lukk-knapp (X) øverst til venstre - alltid synlig */
.doorbell-close-button {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.doorbell-close-button:hover,
.doorbell-close-button:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.98);
}

/* Live badge */
.doorbell-alert-live-badge {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(244, 67, 54, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
    z-index: 10;
}

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

/* Kamera-knapp i header */
.camera-button {
        width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #FF5722 0%, #F44336 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.camera-button:hover,
.camera-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
}

/* Justere header-knapper layout */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Loading state */
.doorbell-loading {
    font-size: 3rem;
    color: white;
    animation: spin 1s linear infinite;
}

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

/* Placeholder når kamera er inaktivt */
.doorbell-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: white;
    font-size: 1.2rem;
}

.doorbell-placeholder-icon {
    font-size: 4rem;
}

/* ============================================
   PHILIPS HUE MODAL
   ============================================ */

.hue-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.hue-modal-overlay.active {
    display: flex;
}

.hue-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.hue-modal-header {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hue-modal-title {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hue-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.hue-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.hue-modal-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.hue-room-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hue-room-card {
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
}

.hue-room-card:hover {
    background: white;
    border-color: #FFC107;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

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

.hue-room-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c2c2c;
}

.hue-room-toggle {
    display: flex;
    gap: 8px;
}

.hue-toggle-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.hue-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hue-toggle-btn.on {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    border-color: #FF9800;
    color: white;
}

.hue-toggle-btn.off {
    background: #9E9E9E;
    border-color: #757575;
    color: white;
}

.hue-brightness-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hue-brightness-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #757575;
    min-width: 70px;
}

.hue-brightness-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #424242 0%, #FFC107 100%);
    border-radius: 5px;
    outline: none;
}

.hue-brightness-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #FFC107;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.hue-brightness-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.hue-brightness-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #FFC107;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.hue-brightness-value {
    font-size: 1rem;
    font-weight: 700;
    color: #FF9800;
    min-width: 45px;
    text-align: right;
}

/* ============================================
   POWER (STRØM) MODAL - KOMPRIMERT
   ============================================ */

.power-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.power-modal-overlay.active {
    display: flex;
}

.power-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    width: 85%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.power-modal-header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.power-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.power-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.power-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.power-modal-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.power-realtime {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border: 2px solid #4CAF50;
}

.power-realtime-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.power-realtime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.power-metric {
    background: white;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.power-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.power-metric-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.power-metric-label {
    font-size: 0.7rem;
    color: #757575;
    font-weight: 600;
    margin-bottom: 5px;
}

.power-metric-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #2E7D32;
    line-height: 1;
    transition: all 0.3s ease;
}

.power-metric-unit {
    font-size: 0.85rem;
    color: #757575;
    margin-left: 2px;
    transition: all 0.3s ease;
}

.power-metric.price-low .power-metric-value {
    color: #4CAF50;
}

.power-metric.price-medium .power-metric-value {
    color: #FF9800;
}

.power-metric.price-high .power-metric-value {
    color: #f44336;
}

.power-charging-active {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 2px solid #FF9800;
}

.power-charging-active .power-metric-value {
    color: #F57C00;
}

.power-charging-inactive {
    opacity: 0.6;
}

.power-section {
    background: #fafafa;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-left: 3px solid #4CAF50;
}

.power-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.power-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.power-stat-item {
    background: white;
    border-radius: 5px;
    padding: 8px;
    border: 2px solid #E0E0E0;
    transition: all 0.2s ease;
}

.power-stat-item:hover {
    border-color: #4CAF50;
    transform: translateX(2px);
}

.power-stat-label {
    font-size: 0.7rem;
    color: #757575;
    font-weight: 600;
    margin-bottom: 4px;
}

.power-stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #424242;
    transition: all 0.3s ease;
}

.power-stat-value.highlight {
    color: #2E7D32;
}

.power-stat-subtext {
    font-size: 0.65rem;
    color: #9E9E9E;
    margin-top: 2px;
}

.power-estimate-badge {
    display: inline-block;
    background: #E3F2FD;
    color: #1976D2;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    margin-left: 4px;
}

.power-mode-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 5px;
}

.power-mode-badge.charging {
    background: #4CAF50;
    color: white;
}

.power-mode-badge.idle {
    background: #9E9E9E;
    color: white;
}

.power-mode-badge.waiting {
    background: #FF9800;
    color: white;
}

.power-charger-control {
    margin-top: 5px;
    display: flex;
    justify-content: center;
}

.power-charger-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.power-charger-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.power-charger-button:active {
    transform: translateY(0);
}

.power-charger-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.power-charger-button.stop-badge {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.power-charger-button.stop-badge:hover {
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.power-live-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 8px rgba(76, 175, 80, 0);
    }
}

/* ============================================
   KALENDER MODAL
   ============================================ */

.calendar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s;
}

.calendar-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: slideUp 0.3s;
}

.calendar-modal-grid {
    max-width: 1200px;
    max-height: 90vh;
}

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

.calendar-modal-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
}

.calendar-modal-title {
    flex: 1;
    text-align: center;
}

.calendar-modal-title > div:first-child {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 3px;
}

.calendar-modal-month {
    font-size: 13px;
    color: #666;
    text-transform: capitalize;
}

.calendar-modal-nav {
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.calendar-modal-nav:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.calendar-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
}

.calendar-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.calendar-modal-content {
    padding: 0 20px 20px;
    overflow-y: auto;
    flex: 1;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-bottom: 2px solid #bdbdbd;
    margin-bottom: 1px;
}

.calendar-weekday {
    background: #f5f5f5;
    padding: 10px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)); /* VIKTIG: minmax(0, 1fr) */
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
}

.calendar-day {
    background: white;
    min-height: 85px;
    padding: 6px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* NY */
    max-width: 100%; /* NY */
}

.calendar-day-empty {
    background: #fafafa;
}

.calendar-day-past {
    background: #f9f9f9;
    opacity: 0.6;
}

.calendar-day-today {
    background: #fff9e6;
}

.calendar-day-today .calendar-day-number {
    background: #ff9800;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.calendar-day-number {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
    padding: 2px;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.calendar-day-event {
    background: #f0f0f0;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1.2;
    color: #333;
    border-left: 3px solid #2196F3;
    overflow: hidden;
    word-wrap: break-word; /* NY */
    overflow-wrap: break-word; /* NY */
    white-space: normal; /* ENDRET fra nowrap */
    max-width: 100%; /* NY */
}

.calendar-event-time-short {
    font-weight: 600;
    color: #666;
}

.calendar-modal-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* ============================================
   VÆRMODAL - KOMPRIMERT
   ============================================ */

.weather-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s;
}

.weather-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: slideUp 0.3s;
    overflow: hidden;
}

.weather-modal-header {
    padding: 18px;
    background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.weather-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.weather-modal-icon {
    font-size: 40px;
}

.weather-modal-day {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 3px;
}

.weather-modal-date {
    font-size: 12px;
    opacity: 0.9;
}

.weather-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.weather-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.weather-modal-content {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
}

.weather-main-temp {
    text-align: center;
    padding: 18px 0;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 18px;
}

.weather-temp-large {
    font-size: 56px;
    font-weight: 300;
    color: #1E88E5;
    line-height: 1;
}

.weather-temp-label {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.weather-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.weather-detail-card {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.weather-detail-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.weather-detail-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.weather-detail-value {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.weather-detail-sub {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* Fjern vindkompass på mindre skjermer */
.weather-compass {
    display: none;
}

@media (max-width: 768px) {
    .calendar-modal-grid {
        width: 95%;
        max-height: 95vh;
    }
    
    .calendar-day {
        min-height: 70px;
        padding: 4px;
    }
    
    .calendar-day-number {
        font-size: 11px;
    }
    
    .calendar-day-event {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .calendar-weekday {
        padding: 6px 3px;
        font-size: 10px;
    }
    
    .weather-modal {
        width: 95%;
    }
    
    .weather-temp-large {
        font-size: 48px;
    }
}

/* ========================================
   ENYAQ (BIL) KNAPP & MODAL - REDESIGN
   ======================================== */

/* Header knapp */
.enyaq-button {
    padding: 6px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.enyaq-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
    display: block;
    border-radius: 50%;
    background: white;
}

.enyaq-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.08);
}

.enyaq-button:active {
    transform: scale(1.05);
}

/* Modal Overlay */
.enyaq-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.enyaq-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.enyaq-modal {
    background: #f5f5f5;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

/* Header */
.enyaq-modal-header {
    background: linear-gradient(135deg, #4A9F7C 0%, #2D7A5E 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.enyaq-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.enyaq-refresh-btn {
    background: rgba(255, 255, 255, 0.0);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.enyaq-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.0);
    transform: rotate(90deg);
}

.enyaq-refresh-btn.loading {
    animation: spin 1s linear infinite;
}

.enyaq-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.enyaq-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Content Area */
.enyaq-modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* ==========================================
   HERO SECTION - Batteri & Rekkevidde
   ========================================== */

.enyaq-hero {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    position: relative;
}

/* Låsestatus - minimal, øverst i høyre hjørne */
.enyaq-lock-status-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.enyaq-lock-status-badge.locked {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.enyaq-lock-status-badge.unlocked {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFB74D;
}

.enyaq-battery-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(#4A9F7C 0%, #4A9F7C var(--battery-percent), #E8E8E8 var(--battery-percent));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.enyaq-battery-inner {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.enyaq-battery-percent {
    font-size: 2.5rem;
    font-weight: 800;
    color: #4A9F7C;
    line-height: 1;
}

.enyaq-battery-icon {
    font-size: 1.5rem;
    margin-top: 4px;
}

.enyaq-range {
    font-size: 3rem;
    font-weight: 800;
    color: #2D7A5E;
    line-height: 1;
    margin-bottom: 4px;
}

.enyaq-range-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Ladeinfo */
.enyaq-charging-info {
    margin-top: 16px;
}

.enyaq-charging-rate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4A9F7C 0%, #2D7A5E 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 159, 124, 0.3);
}

.enyaq-charging-expanded {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: #F0F8F5;
    border-radius: 12px;
}

.enyaq-charge-stat {
    text-align: center;
}

.enyaq-charge-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2D7A5E;
    line-height: 1.2;
}

.enyaq-charge-stat-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    font-weight: 500;
}

/* ==========================================
   KONTROLL SEKSJONER
   ========================================== */

.enyaq-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.enyaq-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2D7A5E;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ALLE KONTROLLER PÅ ÉN LINJE */
.enyaq-controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.enyaq-control-card {
    background: #F8F8F8;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.enyaq-control-card:hover {
    border-color: #4A9F7C;
    background: white;
}

.enyaq-control-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.enyaq-control-icon {
    font-size: 1.8rem;
}

.enyaq-control-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Fjern bare gamle låsestatus styles */
.enyaq-lock-box,
.enyaq-lock-display,
.enyaq-lock-icon,
.enyaq-lock-text {
    display: none !important;
}

/* Behold enyaq-top-grid men gjør den synlig */
.enyaq-top-grid {
    display: none !important;
}

/* Ladegrense knapper - vertikalt i ett kort */
.enyaq-charge-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.enyaq-charge-btn {
    padding: 10px;
    border: 2px solid #E0E0E0;
    background: white;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.enyaq-charge-btn:hover {
    border-color: #4A9F7C;
    background: #F0F8F5;
}

.enyaq-charge-btn.active {
    background: linear-gradient(135deg, #4A9F7C 0%, #2D7A5E 100%);
    border-color: #4A9F7C;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 159, 124, 0.3);
}

/* Fjern gamle låsestatus styles */
.enyaq-lock-box,
.enyaq-lock-display,
.enyaq-lock-icon,
.enyaq-lock-text,
.enyaq-top-grid {
    display: none !important;
}



.enyaq-climate-temp {
    text-align: center;
    margin-bottom: 10px;
}

.enyaq-climate-temp-value {
    font-size: 2rem;
    font-weight: 800;
    color: #2D7A5E;
    line-height: 1;
}

.enyaq-climate-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.enyaq-temp-btn {
    width: 38px;
    height: 38px;
    border: 2px solid #4A9F7C;
    background: white;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #4A9F7C;
    font-weight: 700;
}

.enyaq-temp-btn:hover {
    background: #4A9F7C;
    color: white;
    transform: scale(1.1);
}

.enyaq-temp-btn:active {
    transform: scale(0.95);
}

.enyaq-climate-toggle {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.enyaq-climate-toggle.on {
    background: linear-gradient(135deg, #4A9F7C 0%, #2D7A5E 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 159, 124, 0.3);
}

.enyaq-climate-toggle.off {
    background: #E0E0E0;
    color: #757575;
}

.enyaq-climate-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Vindusvarme - kompakt knapp */
.enyaq-toggle-btn {
    width: 100%;
    padding: 30px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.enyaq-toggle-btn.on {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.enyaq-toggle-btn.off {
    background: #E0E0E0;
    color: #757575;
}

.enyaq-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

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

/* Loading tekst */
.loading-text {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* ========================================
   APPLE TV KNAPP & MODAL
   ======================================== */

/* Header knapp */
.appletv-button {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d1d1f 0%, #000000 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.appletv-button:hover {
    background: linear-gradient(135deg, #2d2d2f 0%, #1a1a1a 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.08);
}

.appletv-button:active {
    transform: scale(1.05);
}

/* Modal Overlay */
.appletv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.appletv-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.appletv-modal {
    background: #1d1d1f;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

/* Header */
.appletv-modal-header {
    background: linear-gradient(135deg, #1d1d1f 0%, #000000 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.appletv-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.appletv-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.appletv-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Content Area */
.appletv-modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    background: #1d1d1f;
}

/* Remote Control - 2 KOLONNER FRA START */
.appletv-remote {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Venstre kolonne - Now Playing + Controls */
.appletv-left-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Høyre kolonne - Navigation */
.appletv-right-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Now Playing Section - I VENSTRE KOLONNE */
.appletv-now-playing {
    background: #2d2d2f;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.appletv-artwork {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: #3d3d3f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.appletv-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.appletv-now-playing-info {
    flex: 1;
    min-width: 0;
}

.appletv-media-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appletv-media-artist {
    font-size: 0.85rem;
    color: #a1a1a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appletv-app-name {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.7rem;
    color: #a1a1a6;
    margin-top: 6px;
}

/* D-pad Navigation */
.appletv-dpad {
    display: grid;
    grid-template-areas: 
        ". up ."
        "left select right"
        ". down .";
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.appletv-btn-up { grid-area: up; }
.appletv-btn-down { grid-area: down; }
.appletv-btn-left { grid-area: left; }
.appletv-btn-right { grid-area: right; }
.appletv-btn-select { 
    grid-area: select; 
    background: rgba(255, 255, 255, 0.15) !important;
    font-size: 1.2rem;
}

.appletv-remote-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.appletv-remote-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.appletv-remote-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

/* Playback Controls */
.appletv-playback {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.appletv-playback-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.appletv-playback-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.appletv-playback-btn:active {
    transform: scale(0.95);
}

/* Menu Buttons */
.appletv-menu-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.appletv-menu-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    padding: 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.appletv-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Volume Controls - i venstre kolonne */
.appletv-volume {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
}

.appletv-volume-label {
    color: #a1a1a6;
    font-size: 0.85rem;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

.appletv-volume-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.appletv-volume-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.appletv-volume-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.appletv-volume-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.appletv-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.appletv-volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Power Button - special styling */
.appletv-power {
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.3);
    margin-top: 12px;
}

.appletv-power:hover {
    background: rgba(255, 59, 48, 0.25);
}