/* Mastering MOSS - Maritime Operator Safety System Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

html {
  position: relative;
  min-height: 100%;
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  padding: 70px 0px 0px !important;
  margin: 0px;
  margin-bottom: 60px;
  font-family: 'Roboto', sans-serif;
}

/* Primary Colors */
:root {
  --moss-primary: #175492;
  --moss-primary-dark: #0b4177;
  --moss-secondary: #d4dce2;
  --moss-accent: #d9534f;
}

/* Links */
a {
  color: var(--moss-primary);
  transition: 300ms ease;
}

a:hover {
  color: var(--moss-primary-dark);
}

/* Navbar Styling */
.navbar {
  background-color: var(--moss-primary) !important;
  border-color: var(--moss-primary) !important;
  padding: 10px 0px !important;
}

.navbar-brand {
  color: #fff !important;
  font-family: 'Roboto', sans-serif;
  height: auto !important;
  line-height: 40px !important;
  padding: 0px 15px !important;
}

.navbar-brand:hover,
.navbar-brand:focus {
  color: #fff !important;
  outline: none !important;
}

.navbar-brand img {
  margin: 0px 12px 0px 0px;
  float: left;
  width: 40px;
  height: 40px;
}

.navbar-nav .nav-link {
  color: var(--moss-secondary) !important;
  transition: 300ms ease;
  text-shadow: none;
  line-height: 25px;
  font-family: 'Roboto', sans-serif;
  padding: 10px 15px !important;
}

.navbar-nav .nav-link:hover {
  color: #fff !important;
  background: var(--moss-primary-dark);
}

.navbar-nav .nav-link.active {
  color: #fff !important;
  background: var(--moss-primary-dark);
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
}

.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%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.dropdown-menu {
  background-color: #fff;
  border: 1px solid #ddd;
}

.dropdown-item {
  padding: 8px 20px;
  transition: 300ms ease;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.dropdown-item i {
  margin-right: 8px;
}

/* Buttons */
.btn {
  transition: 300ms ease;
  text-shadow: none;
  border-radius: 4px;
}

.btn-primary,
.btn-custom {
  color: #fff;
  background-color: var(--moss-primary);
  border-color: var(--moss-primary);
  border-bottom: 3px solid var(--moss-primary-dark);
}

.btn-primary:hover,
.btn-custom:hover {
  color: #fff !important;
  background-color: var(--moss-primary-dark);
  border-color: var(--moss-primary-dark);
}

.btn-outline-primary {
  color: var(--moss-primary);
  border-color: var(--moss-primary);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--moss-primary);
  border-color: var(--moss-primary);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--moss-primary);
}

/* Footer */
footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 50px;
  line-height: 50px;
  background-color: #313131;
}

footer .text-muted {
  color: #a0a0a0 !important;
}

/* Cards */
.card {
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  margin-bottom: 15px;
  transition: 300ms ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: var(--moss-primary);
  color: #fff;
  border-bottom: none;
}

.card-title {
  color: var(--moss-primary);
  font-weight: 500;
}

/* Block Styling (from original) */
.block {
  border: 1px solid #666;
  border-radius: 4px;
  margin-bottom: 15px;
}

.block h4 {
  background: #666;
  color: #fff;
  padding: 10px 12px;
  margin: 0px 0px 0px;
  text-align: left;
}

/* Sidebar */
.sidebar {
  border: 1px solid #e6e6e6;
  border-radius: 4px;
}

.sidebar ul {
  padding: 0px;
  margin: 0px;
  list-style: none;
}

.sidebar ul li {
  position: relative;
  border-bottom: 1px solid #e6e6e6;
}

.sidebar ul li:last-child {
  border-bottom: none;
}

.sidebar ul li a {
  font-size: 14px;
  padding: 14px 15px 12px 25px;
  display: block;
  text-decoration: none;
  color: #666;
  position: relative;
  transition: 300ms ease;
}

.sidebar ul li a:hover {
  padding-left: 28px;
  color: var(--moss-primary);
  background-color: #f8f9fa;
}

.sidebar ul li a i {
  margin-right: 8px;
  position: absolute;
  left: 10px;
  top: 15px;
}

/* Tables */
.table thead th {
  background: #f6f6f6;
  border-bottom: 2px solid var(--moss-primary);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(23, 84, 146, 0.05);
}

/* Forms */
.form-control {
  border-radius: 4px;
  border: 1px solid #ddd;
  transition: 300ms ease;
}

.form-control:focus {
  border-color: var(--moss-primary);
  box-shadow: 0 0 0 0.2rem rgba(23, 84, 146, 0.25);
}

.form-label {
  font-weight: 500;
  color: #333;
}

/* Page Headers */
.page-header {
  margin: 0px 0px 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--moss-primary);
}

.page-header h3 {
  margin: 0px;
  color: var(--moss-primary);
}

/* Section Styling */
.section-title {
  margin: 20px 0px;
}

.section-title h3 {
  color: #333;
  margin: 0px;
  padding: 0px 0px 8px;
  text-align: center;
  font-size: 28px;
}

.title-underline {
  padding: 2px 0px;
  width: 60px;
  margin: 0 auto;
  background-color: var(--moss-primary);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, rgba(23, 84, 146, 0.9) 0%, rgba(11, 65, 119, 0.95) 100%),
              url('/images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  padding: 80px 0;
  margin-bottom: 40px;
  position: relative;
}

.hero-section h1 {
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-section .lead {
  font-size: 1.25rem;
  opacity: 0.9;
}

/* Feature Cards */
.feature-card {
  text-align: center;
  padding: 30px 20px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  transition: 300ms ease;
  height: 100%;
}

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

.feature-card i {
  font-size: 48px;
  color: var(--moss-primary);
  margin-bottom: 20px;
}

.feature-card h5 {
  color: var(--moss-primary);
  font-weight: 600;
  margin-bottom: 15px;
}

/* Pagination */
.pagination .page-link {
  color: var(--moss-primary);
  transition: 300ms ease;
}

.pagination .page-item.active .page-link {
  background-color: var(--moss-primary);
  border-color: var(--moss-primary);
}

.pagination .page-link:hover {
  background-color: var(--moss-primary);
  border-color: var(--moss-primary);
  color: #fff;
}

/* Alerts */
.alert-primary {
  background-color: rgba(23, 84, 146, 0.1);
  border-color: var(--moss-primary);
  color: var(--moss-primary-dark);
}

/* Badge */
.badge-primary,
.bg-primary {
  background-color: var(--moss-primary) !important;
}

/* Required field indicator */
.required,
.mand {
  color: #da1010;
}

/* News Items */
.news-item {
  padding: 12px;
  margin: 0px 0px 8px;
  background: #f5f5f5;
  border-radius: 4px;
  transition: 300ms ease;
}

.news-item:hover {
  background: #eee;
}

.news-item a {
  display: inline-block;
  color: #333;
  font-size: 14px;
  text-decoration: none;
}

/* Dashboard Widgets */
.dashboard-widget {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  transition: 300ms ease;
}

.dashboard-widget:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dashboard-widget h4 {
  color: var(--moss-primary);
  margin-bottom: 15px;
  font-weight: 600;
}

.dashboard-widget .widget-icon {
  font-size: 36px;
  color: var(--moss-primary);
  opacity: 0.2;
  position: absolute;
  right: 20px;
  top: 20px;
}

.dashboard-widget .widget-value {
  font-size: 32px;
  font-weight: 700;
  color: #333;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  body {
    padding-top: 60px !important;
  }

  .hero-section {
    padding: 40px 0;
  }

  .feature-card {
    margin-bottom: 20px;
  }
}

/* Loading Spinner */
.spinner-border {
  color: var(--moss-primary);
}

/* Breadcrumb */
.breadcrumb {
  background-color: transparent;
  padding: 10px 0;
}

.breadcrumb-item a {
  color: var(--moss-primary);
}

.breadcrumb-item.active {
  color: #666;
}

/* Dashboard Sidebar Navigation */
.dashboard-container {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.dashboard-sidebar {
  flex: 0 0 280px;
  max-width: 280px;
  padding: 0 15px;
}

.dashboard-content {
  flex: 1;
  min-width: 0;
  padding: 0 15px;
}

/* Sidebar Nav List */
.sidebar-nav {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  overflow: hidden;
}

.sidebar-nav-header {
  background: var(--moss-primary);
  color: #fff;
  padding: 12px 15px;
  font-weight: 600;
  font-size: 14px;
}

.sidebar-nav-header i {
  margin-right: 8px;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  border-bottom: 1px solid #e6e6e6;
  display: flex;
  align-items: center;
  position: relative;
}

.sidebar-nav li:last-child {
  border-bottom: none;
}

.sidebar-nav li .nav-text {
  flex: 1;
  padding: 12px 15px;
  padding-right: 80px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: all 300ms ease;
  display: flex;
  align-items: center;
}

.sidebar-nav li .nav-text i {
  color: var(--moss-primary);
  margin-right: 10px;
  width: 16px;
  text-align: center;
}

.sidebar-nav li .nav-text:hover {
  background-color: #f8f9fa;
  color: var(--moss-primary);
}

.sidebar-nav li .nav-actions {
  position: absolute;
  right: 10px;
  display: flex;
  gap: 5px;
}

.sidebar-nav li .nav-actions .btn {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
}

.btn-view {
  background: #f0f7ff;
  color: var(--moss-primary);
  border: 1px solid var(--moss-primary);
}

.btn-view:hover {
  background: var(--moss-primary);
  color: #fff;
}

.btn-edit {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #e65100;
}

.btn-edit:hover {
  background: #e65100;
  color: #fff;
}

/* Dashboard Blocks */
.dashboard-block {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.dashboard-block-header {
  background: linear-gradient(135deg, #666 0%, #444 100%);
  color: #fff;
  padding: 12px 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.dashboard-block-header.primary {
  background: linear-gradient(135deg, var(--moss-primary) 0%, var(--moss-primary-dark) 100%);
}

.dashboard-block-header.warning {
  background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
}

.dashboard-block-header.success {
  background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
}

.dashboard-block-header i {
  margin-right: 10px;
}

.dashboard-block-body {
  padding: 15px;
  max-height: 400px;
  overflow-y: auto;
}

/* Allow full-height blocks to expand without scrolling */
.dashboard-block.h-100 {
  display: flex;
  flex-direction: column;
}

.dashboard-block.h-100 .dashboard-block-body {
  flex: 1;
  max-height: none;
  overflow-y: visible;
}

/* Task Items */
.task-category {
  font-weight: 600;
  color: #666;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 6px;
}

.task-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 5px;
  margin-bottom: 4px;
  transition: all 300ms ease;
}

.task-item:hover {
  background: #e9ecef;
  transform: translateX(3px);
}

.task-item .task-text {
  flex: 1;
  color: #333;
  text-decoration: none;
  font-size: 13px;
}

.task-item .task-actions {
  display: flex;
  gap: 5px;
}

.task-item .task-actions a {
  color: #666;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 200ms ease;
}

.task-item .task-actions a:hover {
  background: var(--moss-primary);
  color: #fff;
}

/* Alert Items */
.alert-item {
  padding: 12px;
  background: #f8f9fa;
  border-left: 3px solid var(--moss-primary);
  border-radius: 0 6px 6px 0;
  margin-bottom: 10px;
}

.alert-item .alert-title {
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
}

.alert-item .alert-meta {
  font-size: 12px;
  color: #888;
}

.alert-item a {
  font-size: 13px;
  color: var(--moss-primary);
}

/* Stat Cards Row */
.stat-cards {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 150px;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid #e6e6e6;
  transition: all 300ms ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  opacity: 0.1;
  color: var(--moss-primary);
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--moss-primary);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 13px;
  color: #666;
  margin-top: 5px;
}

.stat-card.primary {
  border-left: 4px solid var(--moss-primary);
}

.stat-card.success {
  border-left: 4px solid #28a745;
}

.stat-card.success .stat-value,
.stat-card.success .stat-icon {
  color: #28a745;
}

.stat-card.info {
  border-left: 4px solid #17a2b8;
}

.stat-card.info .stat-value,
.stat-card.info .stat-icon {
  color: #17a2b8;
}

.stat-card.warning {
  border-left: 4px solid #ffc107;
}

.stat-card.warning .stat-value,
.stat-card.warning .stat-icon {
  color: #e65100;
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
  display: none;
  width: 100%;
  padding: 12px 15px;
  background: var(--moss-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  margin-bottom: 15px;
  font-weight: 500;
  cursor: pointer;
}

.sidebar-toggle i {
  margin-right: 8px;
}

/* Mobile Responsiveness for Dashboard */
@media (max-width: 991px) {
  .dashboard-sidebar {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar-nav {
    display: none;
  }

  .sidebar-nav.show {
    display: block;
  }

  .dashboard-content {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .stat-cards {
    flex-direction: column;
  }

  .stat-card {
    min-width: 100%;
  }
}

/* Touch-friendly targets for mobile/boat use */
@media (max-width: 768px) {
  .sidebar-nav li .nav-text {
    padding: 16px 15px;
    padding-right: 90px;
    min-height: 52px;
  }

  .sidebar-nav li .nav-actions .btn {
    padding: 8px 12px;
    font-size: 14px;
  }

  .task-item {
    padding: 14px;
    min-height: 52px;
  }

  .task-item .task-actions a {
    padding: 8px 10px;
  }

  .btn {
    min-height: 44px;
    padding: 10px 16px;
  }
}
