/* Global CSS Reset and Fixes for HMS System */

/* Reset all margins and padding */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HTML and Body fixes */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

/* Remove Bootstrap's default body padding */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    font-size: 14px;
}

/* Container fixes *  /
.container, .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Main content area fixes */
.main-content {
    margin-left: 220px;
    padding: 10px;
    min-height: 100vh;
    background: #f8f9fa;
}

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

/* Card fixes */
.card {
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-body {
    padding: 1.5rem;
}

/* Table fixes */
.table {
    margin-bottom: 0;
}

.table-responsive {
    border-radius: 5px;
    overflow: hidden;
}

/* Form fixes */
.form-control, .form-select {
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Button fixes */
.btn {
    border-radius: 3px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Modal fixes */
.modal-content {
    border: none;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 15px 15px;
}

/* Sidebar fixes */
.hms-sidebar {
    min-height: 100vh;
    background: #343a40;
    color: #fff;
    width: 220px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    transition: all 0.3s;
    padding: 0;
    margin: 0;
}

.hms-sidebar .nav-link {
    color: #fff;
    padding: 12px 20px;
    border-radius: 0;
    transition: all 0.3s ease;
}

.hms-sidebar .nav-link.active, 
.hms-sidebar .nav-link:hover {
    background: #495057;
    color: #fff;
    transform: translateX(5px);
}

@media (max-width: 991.98px) {
    .hms-sidebar {
        left: -220px;
    }
    .hms-sidebar.show {
        left: 0;
    }
}

/* Login page specific fixes */
.login_container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.login_card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0;
}

/* Dashboard specific fixes */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 500;
}

/* Utility classes */
.no-margin { margin: 0 !important; }
.no-padding { padding: 0 !important; }
.no-border { border: none !important; }
.no-shadow { box-shadow: none !important; }

/* Print fixes */
@media print {
    body {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hms-sidebar,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auto-uppercase for all text inputs */
input[type="text"], 
textarea {
    text-transform: uppercase;
}

/* Ensure the value is also uppercase when displayed */
input[type="text"]:focus,  
textarea:focus {
    text-transform: uppercase;
}

/* Exclude certain fields that should not be uppercase */
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="file"],
input[type="hidden"],
input[type="submit"],
input[type="button"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
input[type="range"],
input[type="color"],
input[type="text"][autocapitalize="none"] {
    text-transform: none;
}

/* Also exclude readonly and disabled fields from uppercase transformation */
input[readonly],
input[disabled],
textarea[readonly],
textarea[disabled] {
    text-transform: none;
} 

.hms-layout {
  display: flex;
  min-height: 100vh;
  background: #f4f6fb;
}

.hms-sidebar {
  width: 220px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: width 0.2s;
}

.sidebar-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 24px 20px 12px 20px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  margin-right: 10px;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 10px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;  
  transition: background 0.2s, color 0.2s;
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.sidebar-footer {
  padding: 18px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.sidebar-username {
  font-size: 0.95rem;
  color: #fff;
}

.hms-main-content {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f4f6fb;
  transition: margin-left 0.2s;
}

.main-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 0 32px;
  background: transparent;
}

.main-title {
  font-size: 1.8rem;  
  font-weight: 700;
  color: #393795;
  margin: 0;
}

.main-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.main-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #667eea;
}

.main-body {
  padding: 32px;
  display: block;
}

@media (max-width: 991.98px) {
  .hms-sidebar {
    width: 60px;
  }
  .hms-main-content {
    margin-left: 60px;
  }
  .sidebar-title, .sidebar-username {
    display: none;
  }
  .sidebar-nav .nav-link span {
    display: none;
  }
  .main-topbar, .main-body {
    padding-left: 16px;
    padding-right: 16px;
  }
} 