/* Language Selector Styles */
.lang-dropdown {
  position: relative;
  margin-left: 10px;
}

.lang-selector {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.lang-selector:hover,
.lang-selector:focus {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 16px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nav-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.language-dropdown {
  min-width: 160px;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: none;
}

.language-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  transition: background-color 0.2s;
}

.language-dropdown .dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.flag-img {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Mobile language button styles */
.mobile-lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.mobile-lang-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.mobile-lang-btn .flag-img {
  width: 24px;
  height: 16px;
}

/* Language modal styles */
.language-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.language-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.3s, transform 0.2s;
}

.language-item:hover {
  background: rgba(79, 70, 229, 0.2);
  transform: none !important;
  padding-left: inherit !important;
}

.language-item .flag-img {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

/* Hero Button Styles */
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 30px;
}

.minimal-btn,
.minimal-outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.minimal-btn {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
}

.minimal-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.minimal-btn:hover::before {
  opacity: 1;
}

.minimal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.minimal-outline-btn {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.minimal-outline-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

/* Responsive Styles */
@media (max-width: 767.98px) {
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mobile-lang-btn {
    margin-top: 10px;
  }
  
  .language-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .nav-flag {
    width: 20px;
    height: 14px;
  }
  
  .lang-selector {
    padding: 0.3rem;
  }
  
  .minimal-btn, 
  .minimal-outline-btn {
    padding: 10px 20px;
  }
}

/* Button Animation */
@keyframes shine {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.minimal-btn.shine {
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 25%, #818cf8 50%, #6366f1 75%, #4f46e5 100%);
  background-size: 200% 100%;
  animation: shine 3s infinite linear;
}

/* RTL Language Support */
html[dir="rtl"] .nav-flag {
  margin-left: 0;
  margin-right: 5px;
}

html[dir="rtl"] .language-dropdown .dropdown-item {
  text-align: right;
}

html[dir="rtl"] .flag-img {
  margin-right: 0;
  margin-left: 10px;
}

/* Styles for language dropdown and buttons */

/* Language dropdown */
.lang-dropdown .dropdown-toggle {
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    left: auto;
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
    top: 100%;
    z-index: 1000;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    background-color: #0f172a;
    background-clip: padding-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* This is the key class that makes the dropdown stay visible */
.lang-dropdown .dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.lang-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.lang-dropdown .dropdown-item:hover,
.lang-dropdown .dropdown-item:focus {
    color: white;
    text-decoration: none;
    background-color: rgba(79, 70, 229, 0.2);
    transform: none !important;
    padding-left: 1rem !important;
}

/* Ensure the language dropdown behaves correctly */
.lang-dropdown {
    position: relative;
}

.dropdown-toggle::after {
    vertical-align: 0.255em !important;
    border-top: 0.3em solid !important;
    border-right: 0.3em solid transparent !important;
    border-left: 0.3em solid transparent !important;
    position: static !important;
    margin-left: 0.255em !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .lang-dropdown .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        background-color: rgba(15, 23, 42, 0.95);
        margin-top: 0;
    }
}

/* Language modal (mobile) */
.language-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.language-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s, transform 0.2s;
}

.language-item:hover {
    background: rgba(79, 70, 229, 0.2);
    transform: none !important;
    padding-left: inherit !important;
}

.language-item.active,
.language-item.selected-language {
    background-color: rgba(0, 0, 0, 0.1);
    border: 2px solid #4f46e5;
    font-weight: 500;
}

.language-item .flag-img {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

/* Mobile language button */
.mobile-lang-btn {
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 5px;
    margin-right: 1rem;
}

.mobile-lang-btn:hover,
.mobile-lang-btn:focus {
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-lang-btn .flag-img {
    margin-right: 0;
    width: 24px;
    height: 16px;
}

/* Language selector styling - modernized */
.language-selector {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

.language-btn {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 7px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.language-btn .flag-icon {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-btn .dropdown-icon {
    margin-left: 8px;
    transition: all 0.3s ease;
    font-size: 10px;
    opacity: 0.8;
}

.language-btn:hover .dropdown-icon {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    min-width: 180px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    overflow: hidden;
}

/* Remove the hover behavior that was making the dropdown disappear */
.language-selector:hover .language-dropdown {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.language-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #f1f5f9;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.language-item:last-child {
    border-bottom: none;
}

.language-item:hover {
    background: rgba(79, 70, 229, 0.2);
    padding-left: inherit !important;
}

.language-item .flag-icon {
    width: 24px;
    height: 18px;
    margin-right: 10px;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-item.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.2), transparent);
    font-weight: 500;
}

.language-item.active::after {
    content: '✓';
    margin-left: auto;
    color: #10b981;
    font-weight: bold;
}

/* Mobile language selector */
.mobile-language-button {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 15px;
    text-align: center;
    margin: 15px 0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-language-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.mobile-language-button .flag-icon {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .language-selector {
        display: none;
    }
    
    .mobile-language-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .language-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.8);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        z-index: 1100;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .language-modal.active {
        opacity: 1;
        visibility: visible;
    }
    
    .language-modal-content {
        background: #1e293b;
        border-radius: 16px;
        width: 90%;
        max-width: 350px;
        overflow: hidden;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
        transform: scale(0.9);
        transition: all 0.3s ease;
    }
    
    .language-modal.active .language-modal-content {
        transform: scale(1);
    }
    
    .language-modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .language-modal-title {
        font-size: 18px;
        font-weight: 600;
        color: white;
        margin: 0;
    }
    
    .language-modal-close {
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        font-size: 24px;
        cursor: pointer;
        padding: 0;
        transition: all 0.3s ease;
    }
    
    .language-modal-close:hover {
        color: white;
        transform: rotate(90deg);
    }
    
    .language-modal-body {
        padding: 15px 0;
    }
    
    .language-modal-item {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        color: #f1f5f9;
        transition: all 0.2s ease;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        cursor: pointer;
    }
    
    .language-modal-item:last-child {
        border-bottom: none;
    }
    
    .language-modal-item:hover {
        background: rgba(79, 70, 229, 0.2);
    }
    
    .language-modal-item .flag-icon {
        width: 28px;
        height: 21px;
        margin-right: 15px;
        border-radius: 3px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .language-modal-item.active {
        background: linear-gradient(90deg, rgba(79, 70, 229, 0.2), transparent);
        font-weight: 500;
    }
    
    .language-modal-item.active::after {
        content: '✓';
        margin-left: auto;
        color: #10b981;
        font-weight: bold;
    }
}

/* Remove hover-only behavior for desktop */
@media (min-width: 992px) {
    .dropdown-menu {
        display: none !important;
    }
    
    /* Only show dropdown when it has the .show class */
    .lang-dropdown .dropdown-menu.show {
        display: block !important;
    }
}

/* Fix for language dropdowns */
.dropdown-item img.flag-icon,
.dropdown-item span {
    display: inline-block !important;
    vertical-align: middle !important;
    transform: none !important;
}
