/* Boondock Monitor - Custom Styles */
/* Color Palette:
   #FFFFFF - White
   #FFD283 - Light Orange/Peach
   #FFFACA - Cream/Pale Yellow
   #0587C7 - Bright Blue
   #002942 - Dark Blue/Navy
   #202020 - Dark Gray/Black
   #F36D22 - Orange
   #D42329 - Red
   #03BBDF - Cyan/Turquoise
   #A4EDFF - Light Blue
*/

/* Light Theme (Default) */
:root {
    --bg-darker: #A4EDFF;
    --bg-dark: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-cream: #FFFACA;
    --border-color: #FFD283;
    --accent-primary: #0587C7;
    --accent-success: #0587C7;
    --accent-warning: #F36D22;
    --accent-danger: #D42329;
    --accent-info: #03BBDF;
    --text-primary: #202020;
    --text-secondary: #002942;
    --text-muted: #002942;
    --shadow: rgba(0, 0, 0, 0.1);
    --hover-bg: rgba(5, 135, 199, 0.1); /* #0587C7 with opacity */
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-darker: #002942;
    --bg-dark: #202020;
    --bg-card: rgba(0, 41, 66, 0.9);
    --bg-cream: #002942;
    --border-color: #0587C7;
    --accent-primary: #03BBDF;
    --accent-success: #03BBDF;
    --accent-warning: #F36D22;
    --accent-danger: #D42329;
    --accent-info: #A4EDFF;
    --text-primary: #FFFFFF;
    --text-secondary: #A4EDFF;
    --text-muted: #A4EDFF;
    --shadow: rgba(0, 0, 0, 0.5);
    --hover-bg: rgba(3, 187, 223, 0.2); /* #03BBDF with opacity */
}

body {
    background: var(--bg-darker);
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

.navbar {
    background: var(--bg-card) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--accent-primary) !important;
    box-shadow: 0 2px 10px var(--shadow);
}

.navbar-brand {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
}

/* Tab Navigation */
.tab-nav {
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow);
}
.tab-nav .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 1rem 2rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    transition: all 0.2s;
}
.tab-nav .nav-link:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}
.tab-nav .nav-link.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: transparent;
}

.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-family: 'JetBrains Mono', monospace;
}

/* Channel Cards - Two Column Layout */
.channel-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 2px 10px var(--shadow);
}

.channel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    transition: background 0.2s ease;
}

.channel-card.channel-playing {
    border-color: var(--accent-success);
}

.channel-card.channel-playing::before {
    background: var(--accent-success);
    animation: pulse-glow 2s infinite;
}

.channel-card.channel-paused {
    border-color: var(--accent-warning);
}

.channel-card.channel-paused::before {
    background: var(--accent-warning);
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.channel-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

    padding: 0.25rem 0.5rem;
    max-width: 180px;
}

.btn-control-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
}

.track-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-success);
    background: var(--hover-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Volume and Noise Controls */
.volume-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-row label {
    min-width: 35px;
}

.volume-row .form-range {
    flex: 1;
}

.volume-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    min-width: 35px;
    text-align: right;
}

.noise-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.noise-select {
    background: var(--bg-dark) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    max-width: 100px;
}

.noise-vol {
    width: 60px !important;
    flex: 0 0 60px;
}

.delay-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.delay-row label {
    min-width: 45px;
}

.delay-row .form-range {
    flex: 1;
}

.delay-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: right;
}

.play-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-success);
    margin-left: 0.5rem;
}

.current-file-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-info);
    background: var(--hover-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delay-badge {
    font-size: 0.6rem;
    background: var(--accent-warning);
    color: #000;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
}

.form-range {
    height: 6px;
}

.form-range::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
}

.form-check-input {
    background-color: var(--bg-dark);
    border-color: var(--border-color);
}

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

/* Theme label fixes */
.form-check-label {
    color: var(--text-secondary) !important;
}

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

.volume-row label,
.delay-row label,
.noise-row label {
    color: var(--text-secondary) !important;
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-select optgroup {
    background: var(--bg-dark);
    color: var(--text-secondary);
}

/* Modal title */
.modal-title {
    color: var(--text-primary) !important;
}

/* Input group text */
.input-group-text {
    background: var(--bg-dark) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Buttons */
.btn-control {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.btn-control:hover:not(:disabled) {
    transform: scale(1.1);
}

.btn-control:disabled {
    opacity: 0.4;
}

.btn-play {
    background: var(--accent-success);
    border: none;
    color: white;
}

.btn-play:hover:not(:disabled) {
    background: #4ec95c;
    color: white;
}

.btn-pause {
    background: var(--accent-warning);
    border: none;
    color: white;
}

.btn-pause:hover {
    background: #e5a82a;
    color: white;
}

.btn-stop {
    background: var(--accent-danger);
    border: none;
    color: white;
}

.btn-stop:hover {
    background: #ff6b63;
    color: white;
}

.btn-test {
    background: var(--accent-info);
    border: none;
    color: white;
}

.btn-test:hover {
    background: #4dd4e0;
    color: white;
}

/* Config Items */
.config-item {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.config-item:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
}

/* File list in modal */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: var(--hover-bg);
}

.file-name-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Table */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
}

.table-dark th {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom-width: 1px;
}

.table-dark td {
    color: var(--text-primary);
    vertical-align: middle;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Form controls */
.form-control, .form-select {
    background: var(--bg-dark) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px var(--hover-bg) !important;
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Modal */
.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 40px var(--shadow);
}

.modal-header, .modal-footer {
    border-color: var(--border-color) !important;
}

/* Badge */
.badge {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

/* Progress bar */
.progress {
    height: 6px;
    border-radius: 3px;
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {
    /* Tab navigation - horizontal scroll */
    .tab-nav {
        padding: 0.5rem;
    }
    
    .tab-nav .container-fluid {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .tab-nav .nav {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .tab-nav .nav::-webkit-scrollbar {
        display: none;
    }
    
    .tab-nav .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .tab-nav .nav-link i {
        margin-right: 0.25rem !important;
    }
    
    /* Config buttons - wrap into grid */
    .tab-nav .d-flex.gap-2 {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem !important;
    }
    
    .tab-nav .d-flex.gap-2 .btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }
    
    .tab-nav .d-flex.gap-2 .btn i {
        margin-right: 0.25rem !important;
    }
    
    /* Global controls */
    .bg-dark.border-bottom .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }
    
    .bg-dark.border-bottom .btn {
        flex: 1;
        min-width: 90px;
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    /* Channel grid - FULL WIDTH single column on mobile */
    #mainChannelGrid > div[class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Channel cards - single column on mobile */
    .channel-card {
        padding: 1rem;
        width: 100%;
    }
    
    .channel-name {
        font-size: 1rem;
        max-width: none;
    }
    
    .btn-control-sm {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .noise-select {
        max-width: 100%;
        flex: 1;
    }
    
    .noise-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .noise-vol {
        width: 100% !important;
        flex: 1 !important;
    }
    
    .volume-row {
        flex-wrap: wrap;
    }
    
    .volume-row label {
        min-width: 50px;
    }
    
    .delay-row {
        flex-wrap: wrap;
    }
    
    /* Modals - full screen on mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-dialog.modal-lg {
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Tables - responsive */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table-dark th,
    .table-dark td {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    /* File items */
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .file-name-display {
        font-size: 0.75rem;
        word-break: break-all;
    }
    
    /* Config items */
    .config-item {
        padding: 0.75rem;
    }
    
    /* Current file info */
    .current-file-info {
        font-size: 0.65rem;
    }
    
    /* Track info */
    .track-info {
        font-size: 0.7rem;
    }
    
    /* Noise upload form */
    #noiseModal .input-group {
        flex-direction: column;
    }
    
    #noiseModal .input-group input,
    #noiseModal .input-group button {
        width: 100%;
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
    }
    
    #noiseModal .input-group input[type="file"] {
        max-width: 100% !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .tab-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .tab-nav .d-flex.gap-2 {
        grid-template-columns: 1fr 1fr;
    }
    
    .btn-control-sm {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .channel-name {
        font-size: 0.85rem;
    }
    
    .chat-icon {
        bottom: 80px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .chat-window {
        bottom: 140px;
        right: 15px;
        left: 15px;
        width: auto;
        height: 400px;
        max-height: calc(100vh - 160px);
    }
    
    .theme-toggle {
        bottom: 15px;
        right: 15px;
    }
}

/* Hamburger button styling */
.hamburger-btn {
    border: none;
    padding: 0.25rem 0.5rem;
}

/* Offcanvas mobile menu styling */
.offcanvas {
    max-width: 280px;
}

.offcanvas .nav-link.active {
    background: var(--hover-bg);
    border-left: 3px solid var(--accent-primary);
}

/* Chat Icon Button */
.chat-icon {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1001;
    transition: all 0.3s ease;
}

.chat-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow);
}

.chat-icon:active {
    transform: scale(0.95);
}

.chat-icon.has-unread {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px var(--shadow);
    }
    50% {
        box-shadow: 0 4px 20px var(--accent-primary), 0 0 0 4px rgba(5, 135, 199, 0.2);
    }
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 170px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 30px var(--shadow);
    display: none;
    flex-direction: column;
    z-index: 1002;
    overflow: hidden;
}

.chat-window.open {
    display: flex;
}

.chat-header {
    background: var(--accent-primary);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.chat-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.chat-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

.chat-username-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.chat-username-text {
    font-weight: 500;
}

.chat-edit-username-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    opacity: 0.8;
}

.chat-edit-username-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.chat-message-username {
    font-weight: 600;
    color: var(--accent-primary);
}

.chat-message.own-message .chat-message-username {
    color: var(--accent-primary);
    opacity: 0.9;
}

.chat-message-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.chat-message-text {
    background: var(--bg-cream);
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    word-wrap: break-word;
    line-height: 1.4;
}

.chat-message.own-message .chat-message-text {
    background: var(--accent-primary);
    color: white;
    margin-left: auto;
    max-width: 80%;
}

.chat-message.own-message {
    align-items: flex-end;
}

.chat-message.own-message .chat-message-header {
    justify-content: flex-end;
}

/* System Messages */
.chat-system-message {
    align-items: center;
    margin: 8px 0;
}

.chat-system-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    padding: 6px 12px;
    background: var(--bg-cream);
    border-radius: 12px;
    display: inline-block;
    margin: 0 auto;
}

/* Typing Indicator */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 8px;
}

.typing-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.typing-dots::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingDot 1.4s infinite;
}

.typing-dots::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingDot 1.4s infinite 0.2s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-send-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--accent-info);
}

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

.chat-username-modal {
    display: none;
}

.chat-username-modal.open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1003;
    align-items: center;
    justify-content: center;
}

.chat-username-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 30px var(--shadow);
}

.chat-username-dialog h5 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.chat-username-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 16px;
}

.chat-username-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-username-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Bootstrap Overrides for Theme Support */
.bg-dark {
    background-color: var(--bg-card) !important;
}

.bg-black {
    background-color: var(--bg-darker) !important;
}

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

.border-secondary {
    border-color: var(--border-color) !important;
}

.offcanvas {
    background-color: var(--bg-card) !important;
}

.offcanvas-header {
    border-bottom-color: var(--border-color) !important;
}

.offcanvas-body {
    color: var(--text-primary);
}

/* Mobile device cards - single column */
@media (max-width: 767px) {
    .device-card .row.g-2 {
        flex-wrap: wrap;
    }
    
    .device-card .col-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .device-card .stat-box {
        padding: 0.4rem 0.5rem;
    }
    
    .device-card .stat-value {
        font-size: 1rem;
    }
    
    .device-card .stat-label {
        font-size: 0.65rem;
    }
    
    .device-card .detail-row {
        font-size: 0.75rem;
        flex-wrap: wrap;
    }
    
    .device-card .detail-value {
        font-size: 0.7rem;
        word-break: break-all;
    }
    
    /* Terminal page mobile */
    .terminal {
        height: calc(100vh - 450px) !important;
        min-height: 200px !important;
        font-size: 0.75rem !important;
    }
    
    .terminal-line {
        flex-wrap: wrap;
        gap: 0.25rem !important;
    }
    
    .terminal-timestamp {
        min-width: auto !important;
        font-size: 0.65rem;
    }
    
    .terminal-port {
        min-width: auto !important;
        font-size: 0.7rem;
    }
    
    .terminal-message {
        width: 100%;
        font-size: 0.75rem;
    }
    
    /* Sidebar collapse on mobile */
    .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .device-selector {
        padding: 0.75rem;
    }
    
    .device-list, .date-list {
        max-height: 150px !important;
    }
}
