// ========================================
// MODERN LAYOUT COMPONENT STYLES
// ========================================

@import '../../../../styles/design-tokens';

// Legacy form styles (preserved for compatibility)
input[type=text],[type=date], select,textarea {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
// Modern Layout Styles
// ========================================

.modern-layout {
  background: linear-gradient(135deg, $gray-50 0%, $gray-100 100%);
  min-height: 100vh;
}

// Header Styles
// ========================================

.modern-header {
  background: linear-gradient(135deg, $primary-600 0%, $primary-700 100%);
  backdrop-filter: $backdrop-blur-md;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: $shadow-lg;
  position: sticky;
  top: 0;
  z-index: $z-sticky;
  height: $header-height;
  padding: 0 $space-6;
}

.modern-branding {
  display: flex;
  align-items: center;
  gap: $space-4;

  .modern-nav-link {
    display: flex;
    align-items: center;
    gap: $space-4;
    text-decoration: none;
    color: inherit;
    transition: all $duration-200 $ease-out;

    &:hover {
      transform: translateY(-1px);
    }
  }

  .logo-container {
    position: relative;
    display: flex;
    align-items: center;
  }

  .logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: $gradient-primary;
    border-radius: $radius-xl;
    box-shadow: $shadow-md;
    transition: all $duration-300 $ease-out;

    &:hover {
      transform: scale(1.05);
      box-shadow: $shadow-lg;
    }

    .logo-img {
      width: 32px;
      height: 32px;
      object-fit: contain;
      filter: brightness(0) invert(1);
    }

    .logo-glow {
      position: absolute;
      top: -2px;
      left: -2px;
      right: -2px;
      bottom: -2px;
      background: $gradient-primary;
      border-radius: $radius-xl;
      opacity: 0;
      filter: blur(8px);
      transition: opacity $duration-300 $ease-out;
    }

    &:hover .logo-glow {
      opacity: 0.3;
    }
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;

    .company-title {
      font-size: $text-xl;
      font-weight: $font-bold;
      color: $white;
      line-height: 1.2;
    }

    .company-subtitle {
      font-size: $text-xs;
      font-weight: $font-medium;
      color: rgba(255, 255, 255, 0.8);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
  }
}

// Header Navigation
// ========================================

.modern-header-nav {
  display: flex;
  align-items: center;
  gap: $space-2;
  margin-left: $space-8;

  .modern-nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: $radius-lg;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all $duration-200 $ease-out;

    &:hover {
      background: rgba(255, 255, 255, 0.1);
      color: $white;
      transform: translateY(-1px);
    }

    &.active {
      background: rgba(255, 255, 255, 0.2);
      color: $white;
      box-shadow: $shadow-md;
    }

    .nav-icon-wrapper {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .nav-tooltip {
      position: absolute;
      top: -40px;
      left: 50%;
      transform: translateX(-50%);
      background: $gray-900;
      color: $white;
      padding: $space-2 $space-3;
      border-radius: $radius-md;
      font-size: $text-xs;
      font-weight: $font-medium;
      white-space: nowrap;
      opacity: 0;
      visibility: hidden;
      transition: all $duration-200 $ease-out;
      z-index: $z-tooltip;

      &::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 4px solid transparent;
        border-top-color: $gray-900;
      }
    }

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

// Header Actions
// ========================================

.modern-header-actions {
  display: flex;
  align-items: center;
  gap: $space-4;
  margin-left: auto;
}

.modern-user-dropdown {
  .modern-user-button {
    display: flex;
    align-items: center;
    gap: $space-3;
    padding: $space-2 $space-4;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: $radius-xl;
    color: $white;
    text-decoration: none;
    transition: all $duration-200 $ease-out;
    cursor: pointer;

    &:hover {
      background: rgba(255, 255, 255, 0.2);
      border-color: rgba(255, 255, 255, 0.3);
      transform: translateY(-1px);
      box-shadow: $shadow-md;
    }

    .user-avatar {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .avatar-circle {
      width: 36px;
      height: 36px;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: $white;
      font-size: $text-sm;
      font-weight: $font-semibold;
    }

    .user-status-indicator {
      position: absolute;
      bottom: 0;
      right: 0;
      width: 12px;
      height: 12px;
      background: $accent-green;
      border: 2px solid $white;
      border-radius: 50%;
    }

    .user-info {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;

      .user-name {
        font-size: $text-sm;
        font-weight: $font-semibold;
        color: $white;
        line-height: 1.2;
      }

      .user-role {
        font-size: $text-xs;
        color: rgba(255, 255, 255, 0.8);
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }
    }

    .dropdown-arrow {
      font-size: $text-xs;
      color: rgba(255, 255, 255, 0.8);
      transition: transform $duration-200 $ease-out;
    }

    &:hover .dropdown-arrow {
      transform: rotate(180deg);
    }
  }
}

// Dropdown Menu
// ========================================

.modern-dropdown-menu {
  background: $white;
  border: 1px solid $gray-200;
  border-radius: $radius-xl;
  box-shadow: $shadow-xl;
  padding: $space-2;
  min-width: 280px;
  margin-top: $space-2;

  .dropdown-header {
    padding: $space-4;
    border-bottom: 1px solid $gray-200;
    margin-bottom: $space-2;

    .user-profile {
      display: flex;
      align-items: center;
      gap: $space-3;

      .profile-avatar {
        width: 48px;
        height: 48px;
        background: $gradient-primary;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: $white;
        font-size: $text-lg;
        font-weight: $font-semibold;
      }

      .profile-info {
        display: flex;
        flex-direction: column;
        gap: 2px;

        .profile-name {
          font-size: $text-sm;
          font-weight: $font-semibold;
          color: $gray-900;
        }

        .profile-email {
          font-size: $text-xs;
          color: $gray-500;
        }
      }
    }
  }

  .dropdown-divider {
    height: 1px;
    background: $gray-200;
    margin: $space-2 0;
  }

  .modern-dropdown-item {
    display: flex;
    align-items: center;
    gap: $space-3;
    padding: $space-3 $space-4;
    border-radius: $radius-lg;
    color: $gray-700;
    text-decoration: none;
    font-size: $text-sm;
    font-weight: $font-medium;
    transition: all $duration-200 $ease-out;

    &:hover {
      background: $gray-50;
      color: $gray-900;
      transform: translateX(4px);
    }

    &.logout-item {
      color: $accent-red;

      &:hover {
        background: rgba($accent-red, 0.1);
        color: $accent-red;
      }
    }

    clr-icon {
      font-size: $text-base;
      width: 20px;
      height: 20px;
    }
  }
}

// Language Dropdown
// ========================================

.modern-language-dropdown {
  .modern-language-button {
    display: flex;
    align-items: center;
    gap: $space-3;
    padding: $space-3 $space-4;
    width: 100%;
    background: transparent;
    border: none;
    color: $gray-700;
    text-decoration: none;
    font-size: $text-sm;
    font-weight: $font-medium;
    border-radius: $radius-lg;
    transition: all $duration-200 $ease-out;
    cursor: pointer;

    &:hover {
      background: $gray-50;
      color: $gray-900;
    }

    .language-icon {
      font-size: $text-base;
      color: $primary-600;
    }

    .dropdown-arrow {
      margin-left: auto;
      font-size: $text-xs;
      color: $gray-400;
      transition: transform $duration-200 $ease-out;
    }

    &:hover .dropdown-arrow {
      transform: rotate(180deg);
    }
  }

  .modern-language-menu {
    background: $white;
    border: 1px solid $gray-200;
    border-radius: $radius-xl;
    box-shadow: $shadow-lg;
    padding: $space-2;
    min-width: 200px;
    margin-left: $space-2;

    .modern-lang-item {
      display: flex;
      align-items: center;
      gap: $space-3;
      padding: $space-3 $space-4;
      border-radius: $radius-lg;
      color: $gray-700;
      text-decoration: none;
      font-size: $text-sm;
      font-weight: $font-medium;
      transition: all $duration-200 $ease-out;

      &:hover {
        background: $primary-50;
        color: $primary-700;
        transform: translateX(4px);
      }

      .lang-icon {
        font-size: $text-base;
        color: $primary-600;
      }

      .lang-flag {
        margin-left: auto;
        font-size: $text-lg;
      }
    }
  }
}

// Content Container
// ========================================

.modern-content-container {
  display: flex;
  min-height: calc(100vh - #{$header-height});
  background: transparent;
}

.modern-content-area {
  flex: 1;
  background: transparent;
  padding: 0;
  overflow-x: hidden;

  .content-wrapper {
    padding: $space-6;
    min-height: calc(100vh - #{$header-height});
  }
}

// Sidebar Styles
// ========================================

.modern-sidebar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: $backdrop-blur-md;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: $shadow-lg;
  width: $sidebar-width;
  transition: all $duration-300 $ease-out;

  &.nav-collapsed {
    width: $sidebar-width-collapsed;
  }

  .sidebar-content {
    padding: $space-4 0;
  }

  .menu-item-wrapper {
    margin-bottom: $space-2;
  }
}

// Navigation Groups
// ========================================

.modern-nav-group {
  margin-bottom: $space-2;

  .nav-group-header {
    display: flex;
    align-items: center;
    gap: $space-3;
    padding: $space-3 $space-4;
    color: $gray-700;
    font-size: $text-sm;
    font-weight: $font-semibold;
    cursor: pointer;
    border-radius: $radius-lg;
    margin: 0 $space-2;
    transition: all $duration-200 $ease-out;

    &:hover {
      background: $gray-50;
      color: $gray-900;
    }

    .nav-group-icon {
      font-size: $text-lg;
      color: $primary-600;
    }

    .nav-group-title {
      flex: 1;
    }

    .nav-group-arrow {
      font-size: $text-sm;
      color: $gray-400;
      transition: transform $duration-200 $ease-out;

      &.rotated {
        transform: rotate(90deg);
      }
    }
  }

  .modern-nav-children {
    margin-top: $space-1;
    padding-left: $space-4;
  }
}

// Navigation Links
// ========================================

.modern-nav-link,
.modern-nav-link-single {
  display: flex;
  align-items: center;
  gap: $space-3;
  padding: $space-3 $space-4;
  color: $gray-600;
  text-decoration: none;
  font-size: $text-sm;
  font-weight: $font-medium;
  border-radius: $radius-lg;
  margin: 0 $space-2;
  transition: all $duration-200 $ease-out;
  position: relative;

  &:hover {
    background: $primary-50;
    color: $primary-700;
    transform: translateX(4px);
  }

  &.active {
    background: $primary-100;
    color: $primary-800;
    font-weight: $font-semibold;

    &::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 3px;
      height: 20px;
      background: $primary-600;
      border-radius: 0 $radius-sm $radius-sm 0;
    }
  }

  .nav-link-icon {
    font-size: $text-base;
    color: $gray-500;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-link-text {
    flex: 1;
  }

  &:hover .nav-link-icon {
    color: $primary-600;
  }

  &.active .nav-link-icon {
    color: $primary-700;
  }
}

// Responsive Design
// ========================================

@media (max-width: $breakpoint-lg) {
  .modern-header {
    padding: 0 $space-4;
  }

  .modern-header-nav {
    margin-left: $space-4;
    gap: $space-1;

    .modern-nav-icon {
      width: 40px;
      height: 40px;
    }
  }

  .modern-content-area .content-wrapper {
    padding: $space-4;
  }

  .modern-sidebar {
    width: $sidebar-width-collapsed;

    .nav-group-title,
    .nav-link-text {
      display: none;
    }

    .modern-nav-link,
    .modern-nav-link-single {
      justify-content: center;
      padding: $space-3;
    }
  }
}

@media (max-width: $breakpoint-md) {
  .modern-branding .brand-text {
    display: none;
  }

  .modern-user-button .user-info {
    display: none;
  }

  .modern-header-nav {
    display: none;
  }
}

// Legacy styles (preserved for compatibility)
// ========================================

.center-content {
  //width: 100%;
 // max-width: 800px;
  margin: auto;
  // padding: 0 15px;
  // display: flex;
  // flex-direction: row;
  // align-items: center;
  // justify-content: center;
  // flex-wrap: wrap;
  // text-align: center;
}
/* Adjust the language button to be white and center its content vertically */
.lang-btn {
  padding: 12px 15px;
  background-color: #007bff; /* Blue background */
  color: white; /* White text color */
  border: none;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background-color: #0056b3; /* Darker blue on hover */
}

.lang-btn .language-icon,
.lang-btn .caret-icon {
  color: white; /* White color for icons */
}

/* Make sure the label inside the button is also white */
.lang-btn .language-label {
  color: white; /* White color for the text */
  margin-right: 8px;
}

/* Center the dropdown menu */
.lang-dropdown-menu {
  background-color: #f8f9fa;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 200px;
  font-size: 14px;
}

/* Style for each item in the dropdown */
.lang-item {
  padding: 10px;
  display: flex;
  align-items: center;
  color: #333; /* Default text color for dropdown items */
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.lang-item:hover {
  background-color: #016692; /* Blue on hover */
  color: white; /* White text on hover */
}

/* Icon style inside each dropdown item */
.lang-icon {
  margin-right: 10px;
  color: #007bff; /* Blue color for icons in dropdown */
}

/* Change text and icon to white when the dropdown is active */
.lang-item .lang-icon {
  color: white;
}

/* Add some padding for top center positioning */
.clr-dropdown button {
  padding-top: 10px; /* Adjust top padding as needed */
  padding-bottom: 10px; /* Ensure button is evenly spaced */
}

/* Optional: Add a separator between the dropdown items */
.lang-item:not(:last-child) {
  border-bottom: 1px solid #ddd;
}

/* Ensure proper alignment of the dropdown icon and label */
.clr-dropdown button .language-label,
.clr-dropdown button .language-icon {
  display: inline-block;
  vertical-align: middle;
}
