/* Contemporary Smart Home Control Panel */

:root {
    /* Light mode colors */
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --text-primary: #333;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --text-header: white;
    --text-header-subtitle: rgba(255,255,255,0.8);
    --card-bg: rgba(255,255,255,0.95);
    --card-bg-solid: white;
    --card-border: rgba(255,255,255,0.2);
    --input-bg: white;
    --input-border: #e2e8f0;
    --shadow-color: rgba(0,0,0,0.1);
    --shadow-color-light: rgba(0,0,0,0.05);
    --category-border: #667eea;
    --btn-short-bg: #667eea;
    --btn-short-hover: #5568d3;
    --btn-long-bg: #764ba2;
    --btn-long-hover: #653a8b;
    --switch-pin-bg: rgba(0,0,0,0.05);
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #0f0f1e;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-tertiary: #718096;
    --text-header: #e2e8f0;
    --text-header-subtitle: rgba(226,232,240,0.7);
    --card-bg: rgba(26,32,44,0.95);
    --card-bg-solid: #1a202c;
    --card-border: rgba(255,255,255,0.1);
    --input-bg: #2d3748;
    --input-border: #4a5568;
    --shadow-color: rgba(0,0,0,0.3);
    --shadow-color-light: rgba(0,0,0,0.2);
    --category-border: #667eea;
    --btn-short-bg: #667eea;
    --btn-short-hover: #5568d3;
    --btn-long-bg: #764ba2;
    --btn-long-hover: #653a8b;
    --switch-pin-bg: rgba(255,255,255,0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Container and layout */
.app-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.header h1 {
    color: var(--text-header);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header .subtitle {
    color: var(--text-header-subtitle);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Dark Mode Toggle */
.theme-toggle {
    position: absolute;
    top: 0;
    /* right: 0; */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-toggle-icon {
    transform: rotate(20deg);
}

.theme-toggle-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Main content area */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.flex-logo {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 
        0 20px 40px var(--shadow-color),
        0 1px 3px var(--shadow-color-light);
    border: 1px solid var(--card-border);
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, border 0.3s ease;
}

/* Switch categories */
.switch-category {
    margin-bottom: 30px;
}

.switch-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 4px;
    border-left: 4px solid var(--category-border);
}

/* Switch grid */
.switch-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Switch cards */
.switch-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 4px 6px var(--shadow-color-light),
        0 1px 3px var(--shadow-color);
    border: 1px solid var(--card-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.switch-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.switch-item:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 25px var(--shadow-color),
        0 4px 10px var(--shadow-color-light);
}

.switch-item:hover::before {
    transform: scaleX(1);
}

.switch-info {
    margin-bottom: 15px;
}

.switch-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.3;
}

.switch-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.switch-pin {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    background: var(--switch-pin-bg);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* Control buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.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;
}

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

.btn-short {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    box-shadow: 0 4px 14px rgba(72,187,120,0.3);
}

.btn-short:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(72,187,120,0.4);
}

.btn-long {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
    box-shadow: 0 4px 14px rgba(245,101,101,0.3);
}

.btn-long:hover {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245,101,101,0.4);
}

/* Duration Control */
.duration-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
}

.duration-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.duration-input {
    flex: 1;
    background: rgba(245, 101, 101, 0.08);
    border: 1px solid rgba(245, 101, 101, 0.25);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
}

.duration-input:focus {
    outline: none;
    background: rgba(245, 101, 101, 0.12);
    border-color: #f56565;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.15);
}

.duration-input:hover {
    border-color: rgba(245, 101, 101, 0.4);
}

.duration-unit {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0.7;
}

/* System controls */
.controls-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

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

.control-btn {
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.control-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;
}

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

.btn-test {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    box-shadow: 0 4px 14px rgba(66,153,225,0.3);
}

.btn-test:hover {
    background: linear-gradient(135deg, #3182ce, #2c5aa0);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66,153,225,0.4);
}

.btn-plex {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
    box-shadow: 0 4px 14px rgba(237,137,54,0.3);
}

.btn-plex:hover {
    background: linear-gradient(135deg, #dd6b20, #c05621);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(237,137,54,0.4);
}

/* Footer */
.footer {
    background: rgba(0,0,0,0.1);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin-top: 30px;
    border-radius: 16px;
}

.footer a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    color: white;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */

/* Mobile First - Small devices */
@media (max-width: 640px) {
    .app-container {
        padding: 15px;
    }
    
    .flex-logo {
        padding: 20px;
        max-width: none;
    }
    
    /* Navigation menu mobile */
    .nav-menu {
        gap: 8px;
        margin-top: 16px;
    }
    
    .nav-menu-item {
        padding: 8px 12px;
        font-size: 0.85rem;
        gap: 4px;
        min-height: 44px;
    }
    
    /* Force text menu items to take full width, pushing icons to next line */
    .nav-menu-item:not(.room-logo) {
        flex: 1 1 100%;
    }
    
    .nav-menu-item i {
        font-size: 1rem;
    }
    
    .nav-menu-item.room-logo {
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
        flex: 1 1 calc(25% - 6px); /* 4 icons per row */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-menu-item.room-logo svg {
        width: 28px;
        height: 28px;
    }
    
    .nav-menu-item.room-logo span {
        font-size: 1.5rem;
        line-height: 1;
    }
    
    .master-controls {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .master-controls-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .master-controls-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-master-trigger {
        padding: 12px 20px;
        font-size: 0.85rem;
        min-width: auto;
        width: 100%;
    }
    
    .switch-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .switch-item {
        padding: 16px;
    }
    
    .button-group {
        gap: 8px;
    }
    
    .btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .control-btn {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
}

/* Tablets */
@media (min-width: 641px) and (max-width: 1024px) {
    .app-container {
        padding: 25px;
    }
    
    .flex-logo {
        max-width: 90%;
        padding: 35px;
    }
    
    .switch-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 18px;
    }
    
    .controls-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .app-container {
        padding: 40px;
    }
    
    .flex-logo {
        max-width: 95%;
        padding: 40px;
    }
    
    .switch-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 20px;
    }
    
    .controls-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .switch-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 25px;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.control-btn:focus,
.switch-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Notification System */
.notification-area {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 300px;
    max-width: 500px;
    transform: translateX(120%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.notification-error {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}

.notification-info {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
}

.notification-warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.5);
    padding: 0;
    margin-left: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

/* Loading and Error States */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.8);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.error-message, .warning-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    margin: 20px;
}

.warning-message {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* Header improvements */
.header-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-toggle-icon {
    transform: rotate(20deg);
}

.theme-toggle-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-profile {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logout-btn {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 15px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    transform: translateY(-1px);
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-header-subtitle);
    font-weight: 400;
    margin: 0;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.nav-menu-item {
    padding: 10px 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px; /* Touch target size */
}

.nav-menu-item:hover {
    background: var(--btn-short-bg);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.nav-menu-item.active {
    background: var(--btn-short-bg);
    color: white;
    border-color: var(--btn-short-bg);
}

.nav-menu-item.room-logo {
    padding: 8px 12px;
    min-width: 44px;
}

.nav-menu-item.room-logo svg {
    width: 28px;
    height: 28px;
}

/* Content area improvements */
.content-area {
    margin-bottom: 40px;
}

/* Quick Access Ribbon */
.quick-access-ribbon {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px var(--shadow-color);
    transition: all 0.3s ease;
}

.ribbon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--card-border);
}

.ribbon-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ribbon-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    min-height: 40px;
}

.quick-badge {
    background: linear-gradient(135deg, var(--btn-short-bg), var(--btn-long-bg));
    border-radius: 20px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.quick-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.quick-badge:active {
    transform: scale(0.95);
}

.quick-badge-active {
    animation: pulse-badge 0.3s ease-in-out;
}

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

.quick-badge-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-badge-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.quick-badge-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.quick-status-dot.status-on {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

.quick-status-dot.status-off {
    background: #6b7280;
    opacity: 0.6;
}

.quick-status-dot.status-unknown {
    background: #f59e0b;
    animation: blink 1.5s ease-in-out infinite;
}

/* Master Controls */
.master-controls {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.master-controls-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.master-controls-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-master-trigger {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 200px;
}

.btn-master-short {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-master-short:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5);
}

.btn-master-long {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.btn-master-long:hover {
    background: linear-gradient(135deg, #dd6b20, #c05621);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.5);
}

.btn-master-trigger.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Mobile responsive improvements */
@media (max-width: 640px) {
    .notification-area {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        min-width: auto;
        max-width: none;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .theme-toggle {
        position: static;
        margin: 10px auto;
    }
    
    .user-profile {
        position: static;
        margin: 10px auto 0;
        width: fit-content;
    }
    
    .header-section {
        padding: 15px 10px;
    }
}

/* Dark mode improvements */
@media (prefers-color-scheme: dark) {
    .notification {
        background: rgba(30, 30, 30, 0.95);
        color: rgba(255, 255, 255, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .notification-close {
        color: rgba(255, 255, 255, 0.5);
    }
    
    .notification-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
    }
}

/* Print styles */
@media print {
    .notification-area,
    .controls-section,
    .footer {
        display: none;
    }
    
    .app-container {
        background: white;
        color: black;
    }
    
    .switch-item {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* Category sections */
.category-section {
    margin-bottom: 35px;
}

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

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding-left: 10px;
    border-left: 4px solid #667eea;
    background: var(--card-bg);
    padding: 12px 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    flex: 1;
    min-width: 200px;
}

.category-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-category-trigger {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-category-short {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-category-short:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-category-long {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.btn-category-long:hover {
    background: linear-gradient(135deg, #dd6b20, #c05621);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.4);
}

.btn-category-trigger.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

/* Enhanced switch item styling */
.switch-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.switch-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.switch-header {
    margin-bottom: 16px;
}

.switch-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.switch-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.switch-description {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0 0 8px 0;
    line-height: 1.3;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.switch-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gpio-pin {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', monospace;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.controller-type {
    background: rgba(118, 75, 162, 0.2);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(118, 75, 162, 0.3);
}

.relay-id {
    background: rgba(237, 137, 54, 0.2);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', monospace;
    border: 1px solid rgba(237, 137, 54, 0.3);
    letter-spacing: 0.5px;
}

.power-channel {
    background: rgba(16, 185, 129, 0.2);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', monospace;
    border: 1px solid rgba(16, 185, 129, 0.3);
    letter-spacing: 0.5px;
}

/* Button group improvements */
.button-group {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-short {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.btn-short:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-long {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
    box-shadow: 0 2px 8px rgba(237, 137, 54, 0.3);
}

.btn-long:hover {
    background: linear-gradient(135deg, #dd6b20, #c05621);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.4);
}

/* Mobile responsive improvements for categories */
@media (max-width: 640px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .category-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .category-title {
        font-size: 1.3rem;
        padding: 10px 16px;
        min-width: auto;
    }
    
    .category-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .btn-category-trigger {
        flex: 1;
        padding: 10px 12px;
        font-size: 0.75rem;
    }
    
    .switch-item {
        padding: 16px;
        min-height: 120px;
    }
    
    .switch-name {
        font-size: 1rem;
    }
    
    .switch-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Tablet improvements */
@media (min-width: 641px) and (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 14px;
    }
}

/* Large desktop improvements */
@media (min-width: 1400px) {
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .switch-item {
        min-height: 150px;
    }
}

/* Power Status Indicators */
.switch-status-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

.status-on {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #059669;
}

.status-on .status-dot {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-off {
    background: rgba(107, 114, 128, 0.15);
    border: 1px solid rgba(107, 114, 128, 0.3);
    color: #acb0b6;
}

.status-off .status-dot {
    background: #6b7280;
    animation: none;
}

.status-unknown {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.status-unknown .status-dot {
    background: #f59e0b;
    animation: blink 1.5s ease-in-out infinite;
}

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

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Mobile responsive for status indicators */
@media (max-width: 640px) {
    .quick-access-ribbon {
        padding: 12px;
    }
    
    .ribbon-title {
        font-size: 0.85rem;
    }
    
    .ribbon-badges {
        gap: 6px;
    }
    
    .quick-badge {
        padding: 6px 10px;
    }
    
    .quick-badge-name {
        font-size: 0.75rem;
    }
    
    .switch-status-container {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .status-indicator {
        font-size: 0.75rem;
        padding: 5px 10px;
        gap: 6px;
    }
    
    .status-dot {
        width: 8px;
        height: 8px;
    }
}

/* Tesla Parking Automation Section */
.tesla-control-section {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.tesla-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tesla-status {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.status-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.status-row:last-child {
    border-bottom: none;
}

.status-row strong {
    color: var(--text-primary);
    margin-right: 8px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.status-enabled {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #059669;
}

.status-badge.status-disabled {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.status-badge.status-present {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #2563eb;
}

.status-badge.status-absent {
    background: rgba(107, 114, 128, 0.15);
    border: 1px solid rgba(107, 114, 128, 0.3);
    color: #6b7280;
}

.status-badge.status-on {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #059669;
}

.status-badge.status-timer {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.tesla-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-tesla-enable,
.btn-tesla-disable {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.btn-tesla-enable {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-tesla-enable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.4);
}

.btn-tesla-enable:active {
    transform: translateY(0);
}

.btn-tesla-disable {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-tesla-disable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.4);
}

.btn-tesla-disable:active {
    transform: translateY(0);
}

.error-message {
    color: #ef4444;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* Mobile responsive for Tesla section */
@media (max-width: 640px) {
    .tesla-section-title {
        font-size: 1.1rem;
    }
    
    .tesla-controls {
        flex-direction: column;
    }
    
    .btn-tesla-enable,
    .btn-tesla-disable {
        width: 100%;
    }
    
    .status-row {
        font-size: 0.85rem;
    }
}

.room-logo{
    font-size: 50px;
}

.style-rgb{
    font-size: 50px;
    animation: rgb-cycle 3s linear infinite;
    display: inline-block;
}

@keyframes rgb-cycle {
  0% { color: #ff0000; } /* Red */
  16.66% { color: #ff00ff; } /* Magenta */
  33.33% { color: #0000ff; } /* Blue */
  50% { color: #00ffff; } /* Cyan */
  66.66% { color: #00ff00; } /* Green */
  83.33% { color: #ffff00; } /* Yellow */
  100% { color: #ff0000; } /* Back to Red */
}

.style-rgb-svg {
  animation: rgb-cycle-svg 3s linear infinite;
}

@keyframes rgb-cycle-svg {
  0% { fill: #ff0000; } /* Red */
  16.66% { fill: #ff00ff; } /* Magenta */
  33.33% { fill: #0000ff; } /* Blue */
  50% { fill: #00ffff; } /* Cyan */
  66.66% { fill: #00ff00; } /* Green */
  83.33% { fill: #ffff00; } /* Yellow */
  100% { fill: #ff0000; } /* Back to Red */
}

/* If you want the stroke/outline to change too */
.style-rgb-svg-stroke {
  /* animation: rgb-cycle-stroke 3s linear infinite; */
  animation: miku-cyan-cycle 3s linear infinite;
}

@keyframes rgb-cycle-stroke {
  0% { stroke: #ff0000; }
  16.66% { stroke: #ff00ff; }
  33.33% { stroke: #0000ff; }
  50% { stroke: #00ffff; }
  66.66% { stroke: #00ff00; }
  83.33% { stroke: #ffff00; }
  100% { stroke: #ff0000; }
}

@keyframes miku-cyan-cycle {
  0% { fill: #00CED1; } /* Dark Turquoise */
  14.28% { fill: #00FFFF; } /* Cyan */
  28.57% { fill: #40E0D0; } /* Turquoise */
  42.85% { fill: #48D1CC; } /* Medium Turquoise */
  57.14% { fill: #00E5E5; } /* Bright Cyan */
  71.42% { fill: #5FDBDB; } /* Light Cyan */
  85.71% { fill: #39C5BB; } /* Miku Teal */
  100% { fill: #00CED1; } /* Back to start */
}

.style-rgb-svg-miku {
  animation: miku-glow 2s ease-in-out infinite;
  filter: drop-shadow(0 0 5px currentColor);
}

@keyframes miku-glow {
  0%, 100% { fill: #39C5BB; } /* Miku's signature teal */
  25% { fill: #00FFFF; } /* Bright cyan */
  50% { fill: #00CED1; } /* Dark turquoise */
  75% { fill: #5FDBDB; } /* Light cyan */
}


/* .style-gi {
  display: inline-block;
  animation: gi-sway 3s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes gi-sway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
} */

.style-gi {
  display: inline-block;
  animation: gi-pulse 1.5s ease-in-out infinite;
}

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


.style-rose {
  display: inline-block;
  animation: rose-present 2s ease-in-out infinite;
}

@keyframes rose-present {
  0%, 100% { 
    transform: rotateY(0deg) scale(1);
  }
  50% { 
    transform: rotateY(180deg) scale(1.05);
  }
}

/* Login page styles */
body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-container .logo {
    font-size: 4rem;
    margin-bottom: 20px;
}

.login-container h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
}

.login-container .subtitle {
    color: #666;
    margin-bottom: 40px;
    font-size: 0.95rem;
}

.login-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.login-btn:active {
    transform: translateY(0);
}

.clear-session-btn {
    display: inline-block;
    background: transparent;
    color: #999;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    cursor: pointer;
    margin-top: 20px;
}

.clear-session-btn:hover {
    background: #f5f5f5;
    color: #666;
    border-color: #999;
}

.security-note {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 0.85rem;
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Scheduling page styles */
.scheduler-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.section-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.pattern-item, .schedule-item {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pattern-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--input-border);
}

.action-step {
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--btn-short-bg);
    color: white;
}

.btn-primary:hover {
    background: var(--btn-short-hover);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-secondary {
    background: var(--text-tertiary);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-secondary);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
}

.action-builder {
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.action-list {
    max-height: 300px;
    overflow-y: auto;
}

.schedule-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-enabled {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-disabled {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.cron-helper {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.nav-link {
    color: var(--text-header);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 500;
}

.nav-link:hover {
    text-decoration: underline;
}

/* Switches component styles */
.switch-card {
    background: rgba(41, 15, 15, 0.3);
    border: 1px solid #f7a41e;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.switch-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(247, 164, 30, 0.3);
}

.switch-card .card-title {
    color: #f7a41e;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.switch-card .card-text {
    color: #cccccc;
    font-size: 0.875rem;
}

.duration-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.duration-label {
    font-size: 0.75rem;
    color: #cccccc;
    margin: 0;
    white-space: nowrap;
}

.duration-input {
    flex: 1;
    background: rgba(247, 164, 30, 0.1);
    border: 1px solid rgba(247, 164, 30, 0.3);
    color: #f7a41e;
    font-size: 0.85rem;
    padding: 4px 8px;
}

.duration-input:focus {
    background: rgba(247, 164, 30, 0.15);
    border-color: #f7a41e;
    box-shadow: 0 0 0 0.2rem rgba(247, 164, 30, 0.25);
    color: #f7a41e;
}

.duration-unit {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
}

/* Plex button component styles */
.plex-status-card {
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 2px solid;
    transition: all 0.3s ease;
}

.plex-online {
    background: linear-gradient(135deg, rgba(0, 150, 0, 0.1) 0%, rgba(0, 100, 0, 0.05) 100%);
    border-color: #28a745;
}

.plex-standby {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.1) 0%, rgba(255, 140, 0, 0.05) 100%);
    border-color: #ff8c00;
}

.plex-offline {
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.1) 0%, rgba(50, 50, 50, 0.05) 100%);
    border-color: #6c757d;
}

.plex-status-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 700;
}

.plex-status-icon {
    font-size: 1.5rem;
}

.plex-status-text {
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.plex-status-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
}

.plex-detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.plex-detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #555;
    font-weight: 700;
}

.plex-detail-value {
    font-size: 1.1rem;
    color: #000;
    font-weight: 900;
}

.plex-status-message {
    padding: 12px 15px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    color: #fff;
    font-size: 0.95rem;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.plex-control-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plex-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Service Status Grid */
.plex-services-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.service-item:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.service-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.service-status {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.status-online {
    background: rgba(40, 167, 69, 0.3);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.status-offline {
    background: rgba(220, 53, 69, 0.3);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

/* Wax Melter Styles */
.wax-melter-section {
    margin: 30px 0;
}

.wax-melter-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-header);
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.wax-melter-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 
        0 8px 16px var(--shadow-color),
        0 1px 3px var(--shadow-color-light);
}

.wax-melter-card {
    padding: 20px;
    border-radius: 8px;
    border: 2px solid;
    transition: all 0.3s ease;
}

.wax-melter-on {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.15) 0%, rgba(255, 69, 0, 0.1) 100%);
    border-color: #ff8c00;
}

.wax-melter-off {
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.1) 0%, rgba(50, 50, 50, 0.05) 100%);
    border-color: #6c757d;
}

.wax-melter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 700;
}

.wax-melter-icon {
    font-size: 1.5rem;
}

.wax-melter-text {
    color: var(--text-primary);
    font-weight: 700;
}

.wax-melter-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.wax-melter-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
}

.wax-melter-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.wax-melter-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.wax-melter-control-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wax-melter-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}