/* 
 * RMediaTech Application Styles
 * Bridges Bootstrap 5 with the RMT Theme Variables
 */

/* --- 1. Scaffolding & Typography --- */
body {
    background-color: var(--rmt-bg-primary);
    color: var(--rmt-text-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--rmt-text-primary);
}

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

/* --- 2. Cards (Fixes "Missing" content in AV view) --- */
.card {
    background-color: var(--rmt-bg-surface);
    border: 1px solid var(--rmt-bg-surface-2);
    color: var(--rmt-text-primary);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--rmt-bg-surface-2);
}

/* --- 3. Buttons (Fixes "Invisible" Get Started button) --- */
.btn-primary {
    background-color: var(--rmt-primary) !important;
    border-color: var(--rmt-primary) !important;
    color: #fff !important;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
    background-color: #1e40af !important;
    /* Blue-800 */
    border-color: #1e40af !important;
    color: #fff !important;
}

.btn-success {
    background-color: var(--rmt-status-success) !important;
    border-color: var(--rmt-status-success) !important;
    color: #fff !important;
}

.btn-light {
    background-color: var(--rmt-bg-surface-2);
    border-color: var(--rmt-bg-surface-2);
    color: var(--rmt-text-primary);
}

.btn-light:hover {
    background-color: #475569;
    border-color: #475569;
    color: #fff;
}

/* --- 4. Navbar & Navigation --- */
.navbar {
    background-color: var(--rmt-bg-surface) !important;
    border-bottom: 1px solid var(--rmt-bg-surface-2);
}

.navbar-brand {
    color: var(--rmt-text-primary) !important;
}

.nav-link {
    color: var(--rmt-text-secondary) !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--rmt-primary) !important;
}

.navbar-toggler {
    border-color: var(--rmt-text-secondary);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(148, 163, 184, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- 5. Forms --- */
.form-control {
    background-color: var(--rmt-bg-surface);
    border-color: var(--rmt-bg-surface-2);
    color: var(--rmt-text-primary);
}

.form-control:focus {
    background-color: var(--rmt-bg-surface);
    border-color: var(--rmt-primary);
    color: var(--rmt-text-primary);
    box-shadow: 0 0 0 0.25rem var(--rmt-primary-dim);
}

/* Chat Offcanvas: dark theme + readable text */
#offcanvas-chat {
    --bs-offcanvas-width: clamp(300px, 85vw, 420px);
    background-color: var(--rmt-bg-surface);
    color: var(--rmt-text-primary);
    border-left: 1px solid var(--rmt-bg-surface-2);
}

#offcanvas-chat .offcanvas-header {
    background: rgba(226, 232, 240, 0.35);
    /* slate-200 tint */
    border-bottom: 1px solid var(--rmt-bg-surface-2);
}

#offcanvas-chat .offcanvas-title {
    color: var(--rmt-text-primary);
    text-shadow: none;
}

/* Close button: default on light */
#offcanvas-chat .btn-close {
    filter: none;
    opacity: 0.8;
}

/* Messages area on light */
#mesh-chat-area {
    background: rgba(226, 232, 240, 0.35);
    /* slate-200 tint */
    color: var(--rmt-text-primary);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 4px;
}

/* Fix labels that use text-dark */
#offcanvas-chat .text-dark {
    color: var(--rmt-text-secondary) !important;
}

/* Inputs in chat panel: light */
#offcanvas-chat .form-control {
    background-color: var(--rmt-bg-surface);
    border-color: var(--rmt-bg-surface-2);
    color: var(--rmt-text-primary);
}

#offcanvas-chat .form-control:focus {
    background-color: var(--rmt-bg-surface);
    border-color: var(--rmt-primary);
    color: var(--rmt-text-primary);
    box-shadow: 0 0 0 0.25rem var(--rmt-primary-dim);
}

#offcanvas-chat .form-control::placeholder {
    color: var(--rmt-text-muted);
    opacity: 0.9;
}

/* Secondary button (paperclip) on light */
#offcanvas-chat .btn.btn-secondary {
    background-color: var(--rmt-bg-surface-2);
    border-color: var(--rmt-bg-surface-2);
    color: var(--rmt-text-primary);
}

#offcanvas-chat .btn.btn-secondary:hover,
#offcanvas-chat .btn.btn-secondary:focus {
    background-color: #cbd5e1;
    /* slate-300 */
    border-color: #cbd5e1;
    color: var(--rmt-text-primary);
}

/* Disabled / Coming Soon Links (restore production look) */
.nav-link.disabled-enhanced,
.dropdown-item.disabled-enhanced {
    opacity: 0.55;
    cursor: not-allowed !important;
}

.nav-link.disabled-enhanced::after,
.dropdown-item.disabled-enhanced::after {
    content: "soon";
    font-size: 0.6em;
    vertical-align: top;
    margin-left: 6px;
    text-transform: uppercase;
    background-color: var(--bs-secondary);
    color: #fff;
    padding: 2px 5px;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Draggable Tools Dock feedback */
#rmt-tools-dock.draggable {
    cursor: grab;
}

#rmt-tools-dock.dragging {
    cursor: grabbing;
}

#dock-toggle {
    touch-action: none;
}

/* Tools Dock: constrain items height for small viewports */
#dock-items {
    max-height: 60vh;
    overflow: auto;
}