/* Dropdown Menu Styles */

.dropdown-menu-wrapper {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    z-index: 10000 !important;
    vertical-align: middle;
}

.dropdown-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    cursor: default;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

.dropdown-trigger:focus {
    outline: none;
}

/* Prevent click on trigger link */
.dropdown-trigger[href] {
    pointer-events: none;
}

.dropdown-trigger:hover {
    color: var(--primary-color);
}

.dropdown-trigger svg {
    transition: transform 0.3s ease;
}

.dropdown-menu-wrapper:hover .dropdown-trigger svg {
    transform: rotate(180deg);
}

/* Create invisible bridge between trigger and menu */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 1rem;
    min-width: 360px;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease 0s, visibility 0s ease 0.2s, transform 0.2s ease 0s;
    z-index: 99999 !important;
    pointer-events: none;
}

.dropdown-menu-wrapper:hover .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
    transition: opacity 0.2s ease 0s, visibility 0s ease 0s, transform 0.2s ease 0s;
}

.dropdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 1.5rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.75rem;
    background: rgba(30, 30, 30, 0.6);
    text-align: center;
    min-height: 120px;
}

.dropdown-item:last-child {
    margin-bottom: 0;
}

.dropdown-item:hover {
    background: rgba(157, 9, 19, 0.2);
    color: var(--primary-color);
    border-color: rgba(157, 9, 19, 0.4);
}

.dropdown-item svg {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.dropdown-item:hover svg {
    opacity: 1;
    stroke: var(--primary-color);
}

.dropdown-item span {
    flex: 1;
}

/* Dropdown Sections */
.dropdown-section {
    margin-bottom: 1rem;
}

.dropdown-section:last-child {
    margin-bottom: 0;
}

/* Grid layout for dropdown items in sections with multiple items */
.dropdown-section:last-child {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
} 

.dropdown-section:last-child .dropdown-section-title,
.dropdown-section:last-child .dropdown-section-desc {
    grid-column: 1 / -1;
}

/* First item (BPB) - left */
.dropdown-section:last-child .dropdown-item:nth-child(3) {
    grid-column: 1;
}

/* Second item (ایران در خاموشی) - right */
.dropdown-section:last-child .dropdown-item:nth-child(4) {
    grid-column: 2;
}

/* Third item (جعبه‌ابزار) - full width bottom */
.dropdown-section:last-child .dropdown-item:nth-child(5) {
    grid-column: 1 / -1;
}

/* Color variants for specific dropdown items */
.dropdown-item.bpb-item {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
}

.dropdown-item.bpb-item:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.dropdown-item.bpb-item:hover svg {
    stroke: #22c55e;
}

.dropdown-item.iran-off-item {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.dropdown-item.iran-off-item:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
}

.dropdown-item.iran-off-item:hover svg {
    stroke: #3b82f6;
}

.dropdown-item.toolkit-item {
    background: rgba(139, 69, 19, 0.1);
    border-color: rgba(139, 69, 19, 0.2);
}

.dropdown-item.toolkit-item:hover {
    background: rgba(139, 69, 19, 0.2);
    border-color: rgba(139, 69, 19, 0.4);
    color: #D2691E;
}

.dropdown-item.toolkit-item:hover svg {
    stroke: #D2691E;
}

.dropdown-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-section-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
    line-height: 1.5;
}

/* Animation for dropdown arrow */
@keyframes dropdownArrow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(2px);
    }
}

.dropdown-menu-wrapper:hover .dropdown-trigger svg {
    animation: dropdownArrow 0.6s ease infinite;
}

/* Mobile - hide dropdown on mobile, show in mobile menu instead */
@media (max-width: 768px) {
    .dropdown-menu-wrapper {
        display: none;
    }
}
