/* Dark Theme Variables */
:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1d29;
    --bg-tertiary: #2d3748;
    --bg-card: #1e2530;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: rgba(255,255,255,0.1);
    --accent-blue: #60a5fa;
    --accent-blue-hover: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --sidebar-width: 260px;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease-in-out;
}

/* Mobile Sidebar Toggle */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.active {
            transform: translateX(0);
        }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .sidebar-overlay.active {
        display: block;
    }
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 998;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: none;
    transition: all 0.3s;
}

    .sidebar-toggle:hover {
        background-color: var(--accent-blue-hover);
        color: white;
    }

@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 20px;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 70px 15px 20px 15px;
    }
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

    .sidebar-header h1 {
        color: var(--accent-blue);
        font-size: 1.5rem;
        font-weight: bold;
        margin: 0;
    }

    .sidebar-header small {
        color: var(--text-muted);
    }

@media (max-width: 768px) {
    .sidebar-header h1 {
        font-size: 1.25rem;
    }
}

/* Project Info */
.project-info {
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid var(--border-color);
}

    .project-info .label {
        font-size: 0.75rem;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .project-info .value {
        font-size: 0.95rem;
        color: white;
        font-weight: 500;
        margin-top: 0.25rem;
        word-break: break-word;
    }

/* Navigation */
.nav-item {
    margin: 0.5rem 1rem;
}

    .nav-item a {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        border: none;
        background: transparent;
        color: var(--text-secondary);
        border-radius: 0.5rem;
        cursor: pointer;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        text-decoration: none;
    }

        .nav-item a:hover {
            background: rgba(255,255,255,0.1);
            color: white;
        }

        .nav-item a.active {
            background: var(--accent-blue-hover);
            color: white;
        }

/* Status Indicator */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-connected {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    position: absolute;
    bottom: 0;
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Card Styles */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    }

.card-body {
    background-color: var(--bg-card);
}

.card-header {
    background-color: var(--accent-blue-hover) !important;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    color: var(--text-primary);
}

/* Button Styles */
.btn-primary {
    background-color: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
}

    .btn-primary:hover {
        background-color: var(--accent-blue);
        border-color: var(--accent-blue);
    }

.btn-outline-primary {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

    .btn-outline-primary:hover {
        background-color: var(--accent-blue);
        border-color: var(--accent-blue);
        color: white;
    }

.btn-success {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
}

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

.btn-outline-danger {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

    .btn-outline-danger:hover {
        background-color: var(--accent-red);
        border-color: var(--accent-red);
        color: white;
    }

/* Responsive Button Groups */
@media (max-width: 576px) {
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .btn {
        width: 100%;
    }
}

/* Alert Styles */
.alert-info {
    background-color: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
    color: var(--accent-blue);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

/* Form Controls */
.form-check-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

    .form-check-input:checked {
        background-color: var(--accent-blue-hover);
        border-color: var(--accent-blue-hover);
    }

.form-check-label {
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    .loading-overlay > div {
        background-color: var(--bg-card);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        padding: 1rem 1.5rem;
        border-radius: 0.5rem;
    }

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Error View */
.error-view {
    text-align: center;
    padding: 4rem 1rem;
}

    .error-view i {
        font-size: 3rem;
        color: var(--accent-red);
    }

@media (min-width: 768px) {
    .error-view {
        padding: 8rem 2rem;
    }

        .error-view i {
            font-size: 4rem;
        }
}

/* Typography */
h2, h3, h4, h5 {
    color: var(--text-primary);
}

h2 {
    font-size: 1.75rem;
}

@media (max-width: 576px) {
    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.1rem;
    }
}

pre {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    overflow-x: auto;
}

/* Feature Cards */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .feature-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 24px rgba(96, 165, 250, 0.2);
    }

    .feature-card i {
        font-size: 3rem;
        color: var(--accent-blue);
        margin-bottom: 1rem;
    }

    .feature-card h4 {
        color: var(--text-primary);
        margin-bottom: 0.75rem;
    }

    .feature-card p {
        color: var(--text-muted);
        font-size: 0.9rem;
    }

/* Screenshot Specific Styles */
.screenshot-card {
    background-color: var(--bg-card);
}

    .screenshot-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

.screenshot-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--bg-secondary);
}

/* Metric Cards - Responsive Grid */
.metric-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .metric-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(96, 165, 250, 0.2);
    }

    .metric-card .metric-value {
        font-size: 2rem;
        font-weight: bold;
        color: var(--accent-blue);
        margin-bottom: 0.5rem;
    }

    .metric-card .metric-label {
        font-size: 0.875rem;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

@media (max-width: 576px) {
    .metric-card {
        padding: 1rem;
    }

        .metric-card .metric-value {
            font-size: 1.5rem;
        }

        .metric-card .metric-label {
            font-size: 0.75rem;
        }
}

/* Tables - Responsive */
.table-responsive {
    overflow-x: auto;
}

.fields-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

    .fields-table th {
        background-color: var(--bg-tertiary);
        color: var(--text-secondary);
        padding: 0.75rem;
        text-align: left;
        font-weight: 600;
        border: 1px solid var(--border-color);
    }

    .fields-table td {
        padding: 0.75rem;
        border: 1px solid var(--border-color);
        color: var(--text-primary);
    }

    .fields-table tr:hover {
        background-color: rgba(96, 165, 250, 0.05);
    }

@media (max-width: 576px) {
    .fields-table {
        font-size: 0.75rem;
    }

        .fields-table th,
        .fields-table td {
            padding: 0.5rem;
        }
}
.accordion-header button {
    background-color: var(--bg-tertiary);
    color: gainsboro;
}

.accordion-button:not(.collapsed) {
    /*background-color: black;*/
    background-color: var(--bg-tertiary);
    color: white;
}

.accordion-item {
    background-color: #202020;
    color: #f0f0f0;
}

/* Accordion - Responsive */
.accordion-button {
    font-size: 1rem;
}

@media (max-width: 576px) {
    .accordion-button {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

    .section-header i {
        color: var(--accent-blue);
    }

@media (max-width: 576px) {
    .section-header {
        font-size: 0.9rem;
    }

        .section-header i {
            font-size: 1rem;
        }
}

/* Breadcrumb - Responsive */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    font-size: 0.875rem;
}

@media (max-width: 576px) {
    .breadcrumb-item {
        font-size: 0.75rem;
    }
}

/* Header Actions - Responsive */
.d-flex.justify-content-between.align-items-center {
    gap: 1rem;
}

@media (max-width: 576px) {
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
    }

        .d-flex.justify-content-between.align-items-center > div {
            width: 100%;
        }

        .d-flex.justify-content-between.align-items-center > button,
        .d-flex.justify-content-between.align-items-center > label {
            width: 100%;
        }
}

/* Screenshot Image - Responsive */
#screenshotImage {
    max-width: 100%;
    max-height: 600px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    #screenshotImage {
        max-height: 400px;
    }
}

/* Bootstrap Override for Dark Theme */
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.spinner-border {
    color: var(--accent-blue);
}

/* Badge Responsive */
.badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
}

@media (max-width: 576px) {
    .badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Screenshot Grid - Responsive */
@media (max-width: 576px) {
    .col-md-4.col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .col-md-4.col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
