/* ========================
   COMPONENT STYLES
   ======================== */

/* Forms */
.form-group {
  margin-bottom: 25px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: var(--font-semibold);
  color: var(--gray-800);
}

.form-group label span[aria-label="required"] {
  color: var(--primary-orange);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--gray-300);
  border-radius: var(--button-radius);
  font-size: var(--text-base);
  font-family: inherit;
  transition: all var(--transition-fast);
  background: var(--theme-white);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px var(--orange-focus);
}

.form-group.error .form-control {
  border-color: var(--accent-red);
}

.form-group.success .form-control {
  border-color: var(--accent-green);
}

.error-message {
  display: block;
  color: var(--accent-red);
  font-size: var(--text-sm);
  margin-top: 5px;
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-message {
  padding: 15px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 25px;
  font-weight: var(--font-medium);
  animation: slideDown 0.3s ease;
}

.form-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards */
.card {
  background: var(--theme-white);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 20px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: var(--primary-orange);
  color: var(--white);
}

.badge-secondary {
  background: var(--gray-200);
  color: var(--gray-800);
}

.badge-success {
  background: var(--accent-green);
  color: var(--white);
}

.badge-warning {
  background: #f59e0b;
  color: var(--white);
}

.badge-danger {
  background: var(--accent-red);
  color: var(--white);
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  background: var(--white);
  border-radius: var(--border-radius);
  max-width: 900px;
  max-height: 90vh;
  width: 90%;
  overflow-y: auto;
  z-index: 1;
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: sticky;
  top: 10px;
  right: 10px;
  float: right;
  background: var(--primary-orange);
  color: var(--white);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform var(--transition-fast);
}

.modal-close:hover {
  transform: rotate(90deg);
}

.modal-body {
  padding: 40px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tabs */
.tabs {
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 30px;
}

.tab-list {
  display: flex;
  gap: 0;
}

.tab-button {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: var(--font-medium);
  color: var(--gray-600);
  transition: all var(--transition-fast);
}

.tab-button.active {
  color: var(--primary-orange);
  border-bottom-color: var(--primary-orange);
}

.tab-button:hover {
  color: var(--primary-orange);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Accordion */
.accordion-item {
  background: var(--white);
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.accordion-question {
  width: 100%;
  padding: 20px 25px;
  background: none;
  border: none;
  text-align: left;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
}

.accordion-question:hover {
  color: var(--primary-orange);
}

.accordion-item.active .accordion-question {
  color: var(--primary-orange);
  border-bottom: 2px solid var(--primary-orange);
}

.accordion-icon {
  width: 24px;
  height: 24px;
  transition: transform var(--transition-fast);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-answer {
  max-height: 500px;
}

.accordion-answer-content {
  padding: 0 25px 25px;
  color: var(--gray-600);
  line-height: 1.8;
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  font-size: var(--text-sm);
}

.breadcrumb-item {
  color: var(--gray-500);
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: var(--gray-400);
}

.breadcrumb-item.active {
  color: var(--primary-orange);
  font-weight: var(--font-medium);
}

.breadcrumb-item a {
  color: var(--gray-600);
  transition: color var(--transition-fast);
}

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

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  color: var(--gray-600);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pagination-item:hover {
  background: var(--primary-orange);
  color: var(--white);
  border-color: var(--primary-orange);
}

.pagination-item.active {
  background: var(--primary-orange);
  color: var(--white);
  border-color: var(--primary-orange);
}

.pagination-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-item.disabled:hover {
  background: transparent;
  color: var(--gray-600);
  border-color: var(--gray-300);
}

/* Progress Bar */
.progress {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary-orange);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Tooltips */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: var(--text-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 1000;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--gray-900);
}

.tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-large {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* Organization Chart */
.org-chart-wrapper {
  width: 100%;
  overflow-x: auto;
  padding: 20px 0;
}

.org-chart {
  display: flex;
  justify-content: center;
  min-width: max-content;
}

.org-chart ul {
  padding-top: 20px;
  position: relative;
  transition: all 0.5s;
  display: flex;
  justify-content: center;
  margin: 0;
  padding-left: 0;
}

.org-chart li {
  float: left;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 20px 10px 0 10px;
  transition: all 0.5s;
}

/* Connectors */
.org-chart li::before,
.org-chart li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 2px solid #ccc;
  width: 50%;
  height: 20px;
}

.org-chart li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid #ccc;
}

.org-chart li:only-child::after,
.org-chart li:only-child::before {
  display: none;
}

.org-chart li:only-child {
  padding-top: 0;
}

.org-chart li:first-child::before,
.org-chart li:last-child::after {
  border: 0 none;
}

.org-chart li:last-child::before {
  border-right: 2px solid #ccc;
  border-radius: 0 5px 0 0;
}

.org-chart li:first-child::after {
  border-radius: 5px 0 0 0;
}

.org-chart ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid #ccc;
  width: 0;
  height: 20px;
}

.org-chart .org-node {
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  border-radius: 4px;
  transition: all 0.3s;
  background: white;
  min-width: 140px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.org-chart .org-node:hover {
  background: var(--primary-orange);
  color: white;
  border-color: var(--primary-orange);
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(255, 107, 0, 0.2);
}

/* Specific Node Styles */
.org-node.level-1 {
  /* Board */
  background: #2c3e50;
  color: white;
  font-size: 15px;
  padding: 15px 25px;
}

.org-node.level-2 {
  /* CEO */
  background: var(--primary-orange);
  color: white;
  font-size: 14px;
}

.org-node.level-3 {
  /* GM */
  background: #f8f9fa;
  border-color: #dee2e6;
}

/* Responsiveness */
@media (max-width: 992px) {
  .org-chart-wrapper {
    overflow-x: auto;
  }
}

@media (max-width: 768px) {

  .org-chart,
  .org-chart ul,
  .org-chart li,
  .org-chart li::before,
  .org-chart li::after,
  .org-chart ul ul::before {
    display: block;
    float: none;
    width: 100%;
    text-align: left;
    padding: 0;
    margin: 0;
    border: none;
    position: static;
  }

  .org-chart ul {
    padding-left: 20px;
    border-left: 2px solid #edf2f7;
    margin-left: 15px;
  }

  .org-chart li {
    margin-bottom: 10px;
    padding-left: 10px;
    position: relative;
  }

  .org-chart li::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    width: 10px;
    height: 2px;
    background: #edf2f7;
    display: block;
    border: none;
    right: auto;
  }

  .org-chart .org-node {
    width: auto;
    display: block;
    min-width: 0;
    margin-bottom: 5px;
  }
}