/* ============================================
   ODDSTRADER PRO - Layout Styles
   Sidebar, Header, Main Content
   ============================================ */

/* === App Container === */
.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* === Sidebar === */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    height: 36px;
    width: auto;
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.brand-pro {
    font-size: 0.65rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 4px;
    vertical-align: super;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--accent-orange);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
}

.nav-badge.pro {
    background: var(--accent-purple);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
}

.plan-badge {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.upgrade-btn {
    width: 100%;
    padding: 10px;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* === Main Content === */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === Header === */
.header {
    height: 64px;
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 30;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 300px;
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-box input:focus {
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

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

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
}

.status-dot.disconnected {
    background: var(--accent-red);
}

.status-dot.connecting {
    background: var(--accent-orange);
    animation: pulse 1s infinite;
}

.header-btn {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-orange);
    border-radius: 50%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-menu:hover {
    border-color: var(--accent-cyan);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

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

/* === Page Content === */
.page-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 20px;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.stat-icon.cyan {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
}

.stat-icon.orange {
    background: rgba(255, 107, 53, 0.1);
    color: var(--accent-orange);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Card === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--accent-cyan);
}

/* === Live Feed === */
.feed-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

.feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
}

.feed-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    animation: slideIn 0.3s ease;
}

.feed-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-cyan);
}

.feed-content {
    flex: 1;
}

.feed-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.feed-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.feed-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* === Live Indicator === */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-green);
    text-transform: uppercase;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* === Alerts === */
.alerts-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all var(--transition-fast);
}

.alert-card:hover {
    border-color: var(--border-accent);
}

.alert-card.critical {
    border-left: 3px solid var(--accent-red);
}

.alert-card.high {
    border-left: 3px solid var(--accent-orange);
}

.alert-card.medium {
    border-left: 3px solid var(--accent-cyan);
}

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

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

.settings-form {
    padding: 20px;
}

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

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

.settings-options {
    padding: 20px;
}

.toggle-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
}

.toggle-option:last-child {
    border-bottom: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    position: relative;
    transition: all var(--transition-fast);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle-option input:checked + .toggle-slider {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.toggle-option input:checked + .toggle-slider::after {
    left: 22px;
    background: white;
}

.toggle-option input {
    display: none;
}

/* === API Key Section === */
.api-key-section {
    padding: 20px;
}

.api-key-display {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.api-key-display code {
    flex: 1;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.api-key-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

/* === Upgrade Plans === */
.upgrade-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.upgrade-plan {
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    text-align: center;
}

.upgrade-plan.featured {
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow);
}

.upgrade-plan h3 {
    margin-bottom: 8px;
}

.price {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    margin-bottom: 20px;
}

.price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}

.upgrade-plan ul {
    list-style: none;
    margin-bottom: 20px;
    text-align: left;
}

.upgrade-plan li {
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.upgrade-plan li i {
    color: var(--accent-green);
    margin-right: 8px;
}

/* === Notification Panel === */
.notification-panel {
    position: fixed;
    top: 64px;
    right: 24px;
    width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 50;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
}

.notification-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .platform-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .upgrade-plans {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .search-box {
        display: none;
    }
    
    .user-name {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
