/**
 * Formdock Mega Menu - Frontend Styles
 */

/* Mega Menu Item */
.formdock-mega-menu-item {
    position: static !important;
}

/* Back Button - versteckt auf Desktop */
.mega-menu-back-btn {
    display: none;
}

.formdock-mega-menu-item > .nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.formdock-mega-menu-item > .nav-link:hover {
    color: #0073aa;
}

.formdock-mega-menu-item > .nav-link .dropdown-arrow {
    transition: transform 0.3s;
}

.formdock-mega-menu-item:hover > .nav-link .dropdown-arrow,
.formdock-mega-menu-item.show > .nav-link .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mega Dropdown */
.formdock-mega-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 1rem 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

/* Pattern Overlay */
.mega-menu-pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.mega-dropdown-inner {
    position: relative;
    z-index: 1;
}

.formdock-mega-menu-item:hover .formdock-mega-dropdown,
.formdock-mega-menu-item.show .formdock-mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-dropdown-inner {
    padding: 2rem 0;
}

/* Mega Menu Content */
.mega-menu-content {
    display: flex;
    gap: 2rem;
}

/* Columns */
.mega-menu-columns {
    display: flex;
    gap: 2rem;
    flex: 1;
}

.mega-menu-column {
    flex: 1;
    min-width: 200px;
}

/* Column Title - mit CSS-Variablen für dynamisches Styling */
.column-title {
    font-size: var(--col-title-size, 0.7rem);
    font-weight: var(--col-title-weight, 600);
    text-transform: var(--col-title-transform, uppercase);
    letter-spacing: var(--col-title-spacing, 0.08em);
    color: var(--col-title-color, #6c757d);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Column Items */
.column-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.column-items li {
    margin-bottom: 0.25rem;
}

/* Mega Menu Link */
.mega-menu-link {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #212529;
    transition: all 0.2s;
}

.mega-menu-link:hover {
    background: #f8f9fa;
    color: #0073aa;
}

.mega-menu-link .item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 0.5rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

.mega-menu-link .item-icon i {
    font-size: 1.1rem;
    color: #495057;
}

.mega-menu-link:hover .item-icon {
    background: #e3f2fd;
}

.mega-menu-link:hover .item-icon i {
    color: #0073aa;
}

.mega-menu-link .item-content {
    display: flex;
    flex-direction: column;
    padding-top: 2px;
}

.mega-menu-link .item-label {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.3;
}

.mega-menu-link .item-description {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}

.mega-menu-link .item-badge {
    margin-left: auto;
    padding: 0.2rem 0.5rem;
    background: #28a745;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 0.25rem;
    align-self: center;
}

/* Compact Link Style */
.mega-menu-link.compact {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    align-items: center;
}

.mega-menu-link.compact i {
    width: auto;
    height: auto;
    background: none;
    font-size: 1rem;
}

/* Promo Section */
.mega-menu-promo {
    width: 280px;
    padding: 1.5rem;
    border-radius: 1rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.mega-menu-promo .promo-image {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.mega-menu-promo .promo-image img {
    width: 100%;
    height: auto;
    display: block;
}

.mega-menu-promo .promo-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #212529;
}

.mega-menu-promo .promo-description {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.mega-menu-promo .promo-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    align-self: flex-start;
}

.mega-menu-promo .promo-button:hover {
    background: #005a87;
    color: #fff;
    transform: translateX(3px);
}

/* Two Column Design */
.design-two-column .mega-menu-columns.two-columns {
    max-width: 600px;
}

/* Four Column Design */
.design-four-column .mega-menu-columns.four-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* Links Only Design */
.design-links-only .links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.design-links-only .links-list a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: #212529;
    text-decoration: none;
    transition: color 0.2s;
}

.design-links-only .links-list a:hover {
    color: #0073aa;
}

/* Color Variants for Icons */
.mega-menu-link[data-color="primary"] .item-icon { background: #e3f2fd; }
.mega-menu-link[data-color="primary"] .item-icon i { color: #0073aa; }

.mega-menu-link[data-color="success"] .item-icon { background: #e8f5e9; }
.mega-menu-link[data-color="success"] .item-icon i { color: #28a745; }

.mega-menu-link[data-color="warning"] .item-icon { background: #fff8e1; }
.mega-menu-link[data-color="warning"] .item-icon i { color: #ffc107; }

.mega-menu-link[data-color="danger"] .item-icon { background: #ffebee; }
.mega-menu-link[data-color="danger"] .item-icon i { color: #dc3545; }

.mega-menu-link[data-color="info"] .item-icon { background: #e0f7fa; }
.mega-menu-link[data-color="info"] .item-icon i { color: #17a2b8; }

/* Responsive */
@media (max-width: 991.98px) {
    .formdock-mega-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        overflow-y: auto;
        transform: translateX(-100%);
    }
    
    .formdock-mega-menu-item:hover .formdock-mega-dropdown,
    .formdock-mega-menu-item.show .formdock-mega-dropdown {
        transform: translateX(0);
    }
    
    .mega-dropdown-inner {
        padding: 1rem;
    }
    
    .mega-menu-content {
        flex-direction: column;
    }
    
    .mega-menu-columns {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .mega-menu-column {
        min-width: auto;
    }
    
    .mega-menu-promo {
        width: 100%;
        margin-top: 1rem;
        padding: 1rem;
    }
    
    .mega-menu-promo .promo-image {
        max-width: 100%;
        margin: 0 auto 0.75rem auto;
    }
    
    .mega-menu-promo .promo-image img {
        max-height: 70px;
        max-width: 280px;
        width: auto;
        margin: 0 auto;
        display: block;
    }
    
    .mega-menu-promo .promo-title {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .mega-menu-promo .promo-description {
        font-size: 0.8rem;
        text-align: center;
        margin-bottom: 0.75rem;
    }
    
    .mega-menu-promo .promo-button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        margin: 0 auto;
        display: block;
        width: fit-content;
    }

    .design-four-column .mega-menu-columns.four-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Mobile Back Button */
    .mega-menu-back-btn {
        display: block;
        width: calc(100% + 2rem);
        padding: 1rem;
        margin: -1rem -1rem 1rem -1rem;
        background: #007bff;
        border: none;
        border-bottom: 1px solid #dee2e6;
        text-align: center;
        font-weight: 600;
        color: #fff;
        cursor: pointer;
        font-size: 14px;
        position: relative;
        z-index: 100;
        transition: background 0.2s, transform 0.1s;
    }
    .mega-menu-back-btn:hover,
    .mega-menu-back-btn:active {
        background: #0056b3;
        transform: scale(0.98);
    }
}

@media (max-width: 575.98px) {
    .design-four-column .mega-menu-columns.four-columns {
        grid-template-columns: 1fr;
    }
    
    .mega-menu-link {
        padding: 0.5rem;
    }
    
    .mega-menu-link .item-icon {
        width: 36px;
        height: 36px;
    }
}

/* Animation Extras */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.formdock-mega-menu-item:hover .mega-menu-column {
    animation: fadeInUp 0.3s ease forwards;
}

.formdock-mega-menu-item:hover .mega-menu-column:nth-child(1) { animation-delay: 0.05s; }
.formdock-mega-menu-item:hover .mega-menu-column:nth-child(2) { animation-delay: 0.1s; }
.formdock-mega-menu-item:hover .mega-menu-column:nth-child(3) { animation-delay: 0.15s; }
.formdock-mega-menu-item:hover .mega-menu-promo { animation-delay: 0.2s; }

