/* 
 * ShadowSteering SaaS - Premium Dealer Dashboard CSS
 * Dark mode, glassmorphic UI 
 */

 :root {
    --bg-dark: #0A0A0A;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-purple: #7b2cbf;
    --primary-blue: #3a0ca3;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    padding: 0;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 40px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    background: rgba(123, 44, 191, 0.2);
    color: var(--text-primary);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    margin-bottom: 20px;
}

.tab-content {
    display: none;
    padding: 0 30px;
}

.tab-content.active {
    display: block;
}

.card {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.btn-primary, .btn-secondary {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
}

/* Modern Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--glass-border);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
}

input:checked + .slider:before {
    transform: translateX(26px);
}

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

.modal-content {
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

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

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-instruction {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 15px;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.connected {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

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

/* Temperature Badges */
.temp-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

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

.temp-warm {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.temp-cold {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0;
}

.status-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.status-box .label {
    color: var(--text-secondary);
}

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

.w-100 {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    border-color: var(--primary-purple);
    background: rgba(123, 44, 191, 0.1);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Filter Input */
.filter-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-input-group input {
    flex: 1;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.helper-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

/* Forms */
.grid-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-purple);
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
}

/* Section headers */
.section-header {
    margin-bottom: 20px;
}

.section-header h1 {
    font-size: 1.5rem;
    margin: 0 0 5px 0;
}

.section-header p {
    color: var(--text-secondary);
    margin: 0;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.no-padding {
    padding: 0;
}

.table-wrapper {
    overflow-x: auto;
}

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

/* Connection status dot */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.logo-icon {
    color: var(--primary-purple);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Animation */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        padding: 10px;
    }
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .grid-form {
        grid-template-columns: 1fr;
    }
}
