html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Remove default body margin - template handles this */
body {
  margin-bottom: 0;
}

/* ========================================
   NAVBAR BUTTONS FIX
======================================== */

/* Ensure navbar-buttons are properly aligned */
header.navbar .navbar-buttons {
  margin-top: 8px;
}

header.navbar .navbar-buttons .btn {
  vertical-align: middle;
}

header.navbar .navbar-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

header.navbar .navbar-buttons .navbar-form {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

header.navbar .navbar-buttons .navbar-form {
  margin: 0;
}

header.navbar .navbar-buttons .btn {
  margin-top: 0; /* override any residual top margin */
}

header.navbar .navbar-buttons .navbar-form .btn {
  margin-right: 0;
}

/* User display button - make it look like info, not clickable */
header.navbar .navbar-buttons .btn.btn-default {
  background-color: transparent;
  background-image: none;
  border-color: transparent;
  color: #FF5F00;
  text-shadow: none;
  pointer-events: none;
  padding-left: 10px;
  padding-right: 10px;
}

/* ========================================
   CONTENT WRAPPER PATTERN FIX
======================================== */

/* Ensure content-wrapper has the correct background pattern */
.content-wrapper {
  background-color: #e5e5e5;
  background-image: url(/images/progaming/pattern.png);
  padding: 20px;
  margin-bottom: 20px;
}

/* ========================================
   FORM CONTROL STYLES
======================================== */

/* Ensure form controls match template styling */
.form-control:focus {
  outline: none;
  box-shadow: none;
  border-color: #aaa;
}

/* ========================================
   ALERT STYLES
======================================== */

/* Style alerts to match template better */
.alert {
  border-radius: 2px;
}

/* ========================================
   BREADCRUMB STYLES
======================================== */

.breadcrumb {
  background-color: #f5f5f5;
  border-radius: 2px;
  margin-bottom: 20px;
}

.breadcrumb > li > a {
  color: #FF5F00;
}

.breadcrumb > li.active {
  color: #777;
}

/* ========================================
   TABLE STYLES
======================================== */

/* Ensure tables match template */
.table > thead > tr > th {
  border-bottom: 2px solid #ddd;
  background-color: #f9f9f9;
}

/* ========================================
   LABEL STYLES
======================================== */

/* Label primary should use template orange */
.label-primary {
  background-color: #FF5F00;
}

/* ========================================
   PAGINATION STYLES
======================================== */

.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > a:focus {
  background-color: #FF5F00;
  border-color: #DB5E14;
}

.pagination > li > a,
.pagination > li > span {
  color: #FF5F00;
}

.pagination > li > a:hover,
.pagination > li > a:focus {
  color: #DB5E14;
}

/* ========================================
   NAV SIDEBAR STYLES (Profile Menu)
======================================== */

.nav-sidebar {
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-sidebar > li > a {
  display: block;
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  color: #555;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-sidebar > li > a:hover {
  background-color: #f5f5f5;
  color: #FF5F00;
}

.nav-sidebar > li > a i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
  color: #FF5F00;
}

.nav-sidebar > li.active > a {
  background-color: #FF5F00;
  color: #fff;
  border-color: #FF5F00;
}

.nav-sidebar > li.active > a i {
  color: #fff;
}

.nav-sidebar > li:last-child > a {
  border-bottom: 0;
}

/* ========================================
   WIDGET WRAPPER STYLES
======================================== */

.widget-wrapper h3 {
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #FF5F00;
  font-size: 18px;
  font-weight: 600;
}

.widget-wrapper h3 i {
  color: #FF5F00;
  margin-right: 8px;
}

/* ========================================
   BOX STYLES
======================================== */

.box h2 {
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  font-size: 22px;
  font-weight: 600;
}

.box h2 i {
  color: #FF5F00;
  margin-right: 10px;
}

/* ========================================
   DROPDOWN MENU STYLES
======================================== */

/* Fix dropdown menu styling */
.dropdown-menu {
  border-radius: 2px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #ddd;
  padding: 5px 0;
  min-width: 200px;
}

.dropdown-menu > li > a {
  padding: 8px 15px;
  color: #333;
  display: block;
  clear: both;
  font-weight: normal;
  line-height: 1.5;
  white-space: nowrap;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background-color: #f5f5f5;
  color: #FF5F00;
  text-decoration: none;
}

.dropdown-menu > li > a > i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

.dropdown-menu .divider {
  margin: 5px 0;
  background-color: #eee;
}

/* Fix for form buttons inside dropdown */
.dropdown-menu > li > form {
  margin: 0;
  padding: 0;
}

.dropdown-menu > li > form > button.btn-link {
  display: block;
  width: 100%;
  padding: 8px 15px;
  text-align: left;
  color: #333;
  background: none;
  border: none;
  font-weight: normal;
  line-height: 1.5;
  white-space: normal;
  text-decoration: none;
}

.dropdown-menu > li > form > button.btn-link:hover,
.dropdown-menu > li > form > button.btn-link:focus {
  background-color: #f5f5f5;
  color: #FF5F00;
  text-decoration: none;
}

.dropdown-menu > li > form > button.btn-link.text-warning:hover {
  color: #d9534f;
}

.dropdown-menu > li > form > button.btn-link > i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

.dropdown-menu > li > form > button.btn-link > small {
  display: block;
  margin-top: 3px;
  margin-left: 24px;
  font-size: 11px;
}

/* Navbar dropdown specific fixes */
.navbar .dropdown-menu {
  background-color: #2a2a2a;
  border-color: #444;
}

.navbar .dropdown-menu > li > a {
  color: #ccc;
}

.navbar .dropdown-menu > li > a:hover,
.navbar .dropdown-menu > li > a:focus {
  background-color: #333;
  color: #FF5F00;
}

.navbar .dropdown-menu .divider {
  background-color: #444;
}

/* ========================================
   MOBILE RESPONSIVE FIXES
======================================== */

@media (max-width: 767px) {
  .content-wrapper {
    padding: 10px;
  }
  
  .content-wrapper .box {
    padding: 10px;
  }
  
  .nav-sidebar > li > a {
    padding: 10px 12px;
  }
  
  /* Fix dropdown on mobile */
  .dropdown-menu {
    min-width: 180px;
  }
  
  .dropdown-menu > li > form > button.btn-link > small {
    display: none;
  }
  
  /* Button groups stack on mobile */
  .btn-group-responsive {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  
  .btn-group-responsive .btn {
    width: 100%;
  }
  
  /* Panel headers - stack content vertically */
  .panel-heading .row .col-md-6:first-child {
    margin-bottom: 10px;
  }
  
  .panel-heading .row .col-md-6.text-right {
    text-align: left !important;
  }
  
  /* Reduce font sizes on mobile */
  .panel-heading h4 {
    font-size: 14px;
  }
  
  /* Breadcrumbs - smaller on mobile */
  .breadcrumb {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  /* Box headers */
  .box h2 {
    font-size: 18px;
  }
  
  .box h3 {
    font-size: 16px;
  }
  
  /* Pull-right buttons in headers - stack below */
  .box h3 .pull-right {
    float: none !important;
    display: block;
    margin-top: 10px;
  }
}

/* ========================================
   RESPONSIVE TABLE ENHANCEMENTS
======================================== */

/* Ensure table-responsive works properly */
.table-responsive {
  min-height: 0.01%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 15px;
}

/* Add shadow hint for scrollable tables */
.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Mobile-friendly table styling */
@media (max-width: 767px) {
  /* Reduce table padding on mobile */
  .table > thead > tr > th,
  .table > tbody > tr > td {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .table-condensed > thead > tr > th,
  .table-condensed > tbody > tr > td {
    padding: 4px 6px;
    font-size: 11px;
  }
  
  /* Hide less important columns on mobile - use .hidden-xs-table */
  .table .hidden-xs-table {
    display: none;
  }
  
  /* Wrap long text in table cells */
  .table td,
  .table th {
    white-space: nowrap;
  }
  
  /* Action buttons in tables - smaller */
  .table .btn-xs {
    padding: 2px 5px;
    font-size: 10px;
  }
  
  /* Stack action buttons vertically if needed */
  .table td form {
    display: inline;
  }
}

/* Alternative: Card-style table on mobile */
@media (max-width: 575px) {
  .table-card-mobile thead {
    display: none;
  }
  
  .table-card-mobile tbody tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
  }
  
  .table-card-mobile tbody td {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: right;
  }
  
  .table-card-mobile tbody td:last-child {
    border-bottom: none;
  }
  
  .table-card-mobile tbody td::before {
    content: attr(data-label);
    font-weight: bold;
    text-align: left;
    color: #666;
  }
}

/* ========================================
   TWITCH BUTTON STYLES
======================================== */

.btn-twitch {
  background-color: #9146FF;
  border-color: #7c3aed;
  color: #fff;
}

.btn-twitch:hover,
.btn-twitch:focus {
  background-color: #7c3aed;
  border-color: #6d28d9;
  color: #fff;
}

.btn-twitch:active,
.btn-twitch.active {
  background-color: #6d28d9;
  border-color: #5b21b6;
  color: #fff;
}

.text-twitch {
  color: #9146FF;
}

/* ========================================
   MOBILE RESPONSIVE FIXES
======================================== */