html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
}

/* Utility: beats Bootstrap's d-flex / d-block !important rules when both are on the same element */
.rs-force-hidden {
    display: none !important;
}

/* ==========================================================================
   Focus Styles
   ========================================================================== */

/* Default focus styles for forms - keep blue accent */
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Top bar button focus/active - subtle yellow accent matching app theme */
.rs-topbar .btn:focus,
.rs-topbar .btn:active,
.rs-topbar .btn:focus:active {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 230, 0, 0.3);
    background-color: rgba(255, 230, 0, 0.1) !important;
    border-color: rgba(255, 230, 0, 0.4) !important;
}

/* Smooth transition for button states */
.rs-topbar .btn {
    transition: all 0.15s ease-in-out;
}

/* Button hover state */
.rs-topbar .btn:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* General button focus - more subtle than form controls */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus {
    box-shadow: 0 0 0 0.15rem rgba(255, 230, 0, 0.25);
    outline: none;
}

/* ==========================================================================
   RemoteSpark Theme Button Overrides
   ========================================================================== */

/* Override Bootstrap's blue btn-primary with RemoteSpark yellow/orange theme */
.btn-primary {
    --bs-btn-color: #000;
    --bs-btn-bg: #ffc107;
    --bs-btn-border-color: #ffc107;
    --bs-btn-hover-color: #000;
    --bs-btn-hover-bg: #ffca2c;
    --bs-btn-hover-border-color: #ffc720;
    --bs-btn-focus-shadow-rgb: 255, 193, 7;
    --bs-btn-active-color: #000;
    --bs-btn-active-bg: #ffcd39;
    --bs-btn-active-border-color: #ffc720;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #000;
    --bs-btn-disabled-bg: #ffc107;
    --bs-btn-disabled-border-color: #ffc107;
}

.btn-primary:focus,
.btn-primary:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.5);
}

/* Success button - keep green for positive actions */
.btn-success {
    --bs-btn-bg: #198754;
    --bs-btn-border-color: #198754;
    --bs-btn-hover-bg: #157347;
    --bs-btn-hover-border-color: #146c43;
}

/* Danger button - keep red for destructive actions */
.btn-danger {
    --bs-btn-bg: #dc3545;
    --bs-btn-border-color: #dc3545;
    --bs-btn-hover-bg: #bb2d3b;
    --bs-btn-hover-border-color: #b02a37;
}

/* Secondary button - dark theme gray */
.btn-secondary {
    --bs-btn-bg: #6c757d;
    --bs-btn-border-color: #6c757d;
    --bs-btn-hover-bg: #5c636a;
    --bs-btn-hover-border-color: #565e64;
}

/* Link style for less prominent actions */
.btn-link {
    --bs-btn-color: #ffc107;
    --bs-btn-hover-color: #ffca2c;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ==========================================================================
   Sidebar Styles
   ========================================================================== */

#sidebar-container {
    transition: width 0.3s;
}

#sidebar-container.sidebar-collapsed {
    width: 48px !important;
    min-width: 48px !important;
    overflow-x: hidden;
}

#sidebar-container.sidebar-collapsed #sidebar-content {
    display: none !important;
}

#sidebar-container.sidebar-collapsed #sidebar-hamburger {
    margin-top: 0;
}

#sidebar-container.sidebar-expanded {
    width: 120px;
    min-width: 120px;
}

#sidebar-hamburger {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.custom-modal .modal-content {
    background: #23272b;
    color: #fff;
    border-radius: 12px;
    border: 1.5px solid #444;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
}

.custom-modal .modal-header {
    border-bottom: 1px solid #333;
    background: #1b1e22;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 18px 24px 12px 24px;
}

.custom-modal .modal-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffe600;
    letter-spacing: 0.5px;
}

.custom-modal .modal-body {
    padding: 24px 24px 12px 24px;
    background: #23272b;
}

.custom-modal .modal-footer {
    border-top: 1px solid #333;
    background: #23272b;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 12px 24px 18px 24px;
}

.custom-modal .btn-close {
    filter: invert(1) grayscale(1);
}

/* Shared Modal styling - apply RemoteSpark theme */
#sharedModal .modal-content {
    background: #23272b;
    color: #fff;
    border-radius: 12px;
    border: 1.5px solid #444;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
}

#sharedModal .modal-header {
    border-bottom: 1px solid #333;
    background: #1b1e22;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

#sharedModal .modal-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffe600;
}

#sharedModal .modal-body {
    background: #23272b;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

#sharedModal .modal-footer {
    border-top: 1px solid #333;
    background: #23272b;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

#sharedModal .btn-close {
    filter: invert(1) grayscale(1);
}

/* Form controls in dark theme */
#sharedModal .form-control {
    background-color: #2d3339;
    border-color: #444;
    color: #fff;
}

#sharedModal .form-control:focus {
    background-color: #2d3339;
    border-color: #ffc107;
    color: #fff;
}

#sharedModal .form-label {
    color: #e0e0e0;
}

#sharedModal .form-text {
    color: #9AA4AA;
}

/* Add-modal option cards – matches unified-tile-card dark theme */
.rs-add-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background-color: #212222;
    border: 2px solid #333;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.rs-add-option:hover,
.rs-add-option:focus-visible {
    border-color: #FFE600;
    background-color: #2a2d30;
    transform: translateY(-2px);
    outline: none;
}

.rs-add-option-icon {
    font-size: 1.75rem;
    color: #FFE600;
    flex-shrink: 0;
}

.rs-add-option-label {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.rs-add-option-desc {
    color: #9AA4AA;
    font-size: 0.8rem;
    margin-top: 2px;
}

/* ==========================================================================
   Alert and Badge Theme Overrides
   ========================================================================== */

/* Primary alerts - use yellow theme */
.alert-primary {
    --bs-alert-color: #000;
    --bs-alert-bg: #fff3cd;
    --bs-alert-border-color: #ffc107;
}

/* Info alerts - use cyan instead of blue */
.alert-info {
    --bs-alert-color: #055160;
    --bs-alert-bg: #cff4fc;
    --bs-alert-border-color: #0dcaf0;
}

/* Primary badges - use yellow theme */
.badge.bg-primary {
    background-color: #ffc107 !important;
    color: #000;
}

/* Link colors for dark theme */
a {
    color: #ffc107;
}

a:hover {
    color: #ffca2c;
}

/* Pagination theme */
.pagination .page-link {
    background-color: #2d3339;
    border-color: #444;
    color: #ffc107;
}

/* Invite modal input improvements */
#sharedModal .form-control {
    border: 2px solid #ffe066;
    background: #232323;
    color: #fff;
}

#sharedModal .form-control::placeholder {
    color: #e0e0e0;
    opacity: 1;
}

#sharedModal .form-control:focus {
    border: 2px solid #ffe066;
    box-shadow: 0 0 0 0.15rem rgba(255, 224, 102, 0.4);
    outline: none;
    background: #232323;
    color: #fff;
}

.pagination .page-link:hover {
    background-color: #3d4349;
    border-color: #555;
    color: #ffca2c;
}

.pagination .page-item.active .page-link {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}