/* ESPBrew V2 - WASM Interface Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #1a1a2e;
    color: #eee;
    line-height: 1.6;
}

#app {
    min-height: 100vh;
}

/* Loading screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #6c5ce7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Navigation bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: #161634;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-title {
    font-size: 18px;
    font-weight: 600;
    color: #eee;
}

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

.status-badge.online {
    background-color: rgba(76, 209, 135, 0.2);
    color: #4cd137;
}

.status-badge.offline {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.status-badge.connecting {
    background-color: rgba(253, 203, 110, 0.2);
    color: #fdcb6e;
}

/* Tab bar */
.tabbar {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    background-color: #1a1a2e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-tab:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #eee;
}

.nav-tab.active {
    background-color: #6c5ce7;
    color: #fff;
}

/* Main content */
.main-content {
    padding: 20px;
}

/* Page */
.page {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Card */
.card {
    background-color: #161634;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.card-content {
    font-size: 14px;
}

/* Button */
.btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #6c5ce7;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #5b4cdb;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: #eee;
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.btn-danger:hover:not(:disabled) {
    background-color: rgba(231, 76, 60, 0.3);
}

.btn-warning {
    background-color: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.btn-warning:hover:not(:disabled) {
    background-color: rgba(241, 196, 15, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.modal-content {
    background-color: #161634;
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    z-index: 10;
    font-weight: bold;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
}

/* Error message */
.error-message {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 20px;
    color: #aaa;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #161634;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    font-size: 12px;
}

.gallery-item-info > div:first-child {
    font-weight: 600;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Control Groups */
.control-group {
    margin-bottom: 16px;
}

.control-group-header {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    color: #eee;
}

/* Slider Component */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.slider-label {
    min-width: 100px;
    font-size: 13px;
    color: #bbb;
}

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

.slider-input::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6c5ce7;
    cursor: pointer;
}

.slider-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6c5ce7;
    cursor: pointer;
    border: none;
}

.slider-value {
    min-width: 40px;
    text-align: right;
    font-size: 13px;
    color: #6c5ce7;
    font-weight: 500;
}

/* Toggle Component */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.toggle-label {
    font-size: 13px;
    color: #bbb;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active {
    background: #6c5ce7;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Preset Buttons */
.preset-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Demo banner */
.demo-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 10000;
    padding: 8px 16px;
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.demo-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.demo-banner-icon {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-banner-exit {
    color: white;
    text-decoration: underline;
    margin-left: auto;
    cursor: pointer;
}

.demo-banner-exit:hover {
    opacity: 0.8;
}
