/**
 * Frontend CSS for Zum Löwen Menu Manager
 */

/* Menu Link Styles */
.zlm-menu-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(139, 69, 19, 0.3);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.zlm-menu-link:hover {
    background: linear-gradient(135deg, #A0522D 0%, #CD853F 100%);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.4);
}

.zlm-menu-link:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.4), 0 0 0 3px rgba(139, 69, 19, 0.2);
}

.zlm-menu-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(139, 69, 19, 0.3);
}

/* PDF Icon */
.zlm-menu-link::before {
    content: "📄";
    margin-right: 8px;
    font-size: 18px;
}

.zlm-menu-link.pdf-icon::before {
    content: "";
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Menu List Styles */
.zlm-menu-list {
    margin: 20px 0;
}

.zlm-menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.zlm-menu-item {
    margin: 0;
}

.zlm-menu-list .zlm-menu-link {
    width: 100%;
    justify-content: space-between;
    text-align: left;
}

.zlm-menu-title {
    flex: 1;
}

.zlm-menu-size {
    font-size: 14px;
    opacity: 0.8;
    margin-left: 10px;
}

/* Restaurant Theme Colors */
.zlm-menu-link.speisekarte {
    background: linear-gradient(135deg, #D2691E 0%, #F4A460 100%);
    box-shadow: 0 2px 5px rgba(210, 105, 30, 0.3);
}

.zlm-menu-link.speisekarte:hover {
    background: linear-gradient(135deg, #F4A460 0%, #DEB887 100%);
    box-shadow: 0 4px 12px rgba(210, 105, 30, 0.4);
}

.zlm-menu-link.weinkarte {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
    box-shadow: 0 2px 5px rgba(139, 0, 0, 0.3);
}

.zlm-menu-link.weinkarte:hover {
    background: linear-gradient(135deg, #DC143C 0%, #FF6347 100%);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.4);
}

.zlm-menu-link.wochenkarte {
    background: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
    box-shadow: 0 2px 5px rgba(34, 139, 34, 0.3);
}

.zlm-menu-link.wochenkarte:hover {
    background: linear-gradient(135deg, #32CD32 0%, #90EE90 100%);
    box-shadow: 0 4px 12px rgba(34, 139, 34, 0.4);
}

/* Loading State */
.zlm-menu-link.loading {
    opacity: 0.7;
    pointer-events: none;
}

.zlm-menu-link.loading::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: zlm-spin 1s linear infinite;
}

@keyframes zlm-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Size Variants */
.zlm-menu-link.small {
    padding: 8px 16px;
    font-size: 14px;
}

.zlm-menu-link.large {
    padding: 16px 24px;
    font-size: 18px;
}

.zlm-menu-link.small::before {
    font-size: 16px;
    margin-right: 6px;
}

.zlm-menu-link.large::before {
    font-size: 22px;
    margin-right: 10px;
}

/* Block Layout */
.zlm-menu-list.block .zlm-menu-items {
    grid-template-columns: 1fr;
}

.zlm-menu-list.inline .zlm-menu-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zlm-menu-list.inline .zlm-menu-link {
    width: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .zlm-menu-items {
        grid-template-columns: 1fr;
    }
    
    .zlm-menu-link {
        padding: 14px 18px;
        font-size: 15px;
    }
    
    .zlm-menu-size {
        font-size: 13px;
    }
    
    .zlm-menu-list.inline .zlm-menu-items {
        flex-direction: column;
    }
    
    .zlm-menu-list.inline .zlm-menu-link {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .zlm-menu-link {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .zlm-menu-link::before {
        font-size: 16px;
        margin-right: 6px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .zlm-menu-link {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .zlm-menu-link:hover {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .zlm-menu-link {
        transition: none;
    }
    
    .zlm-menu-link:hover {
        transform: none;
    }
    
    .zlm-menu-link.loading::after {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .zlm-menu-link {
        background: none !important;
        color: #000 !important;
        box-shadow: none !important;
        border: 1px solid #000 !important;
        text-decoration: underline !important;
    }
    
    .zlm-menu-link::before {
        content: "[PDF] ";
        background: none !important;
        width: auto !important;
        height: auto !important;
        margin-right: 4px !important;
    }
    
    .zlm-menu-link::after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: #666;
    }
}

/* Custom Properties for Theme Integration */
.zlm-menu-link {
    --zlm-primary-color: #8B4513;
    --zlm-primary-hover: #A0522D;
    --zlm-text-color: #fff;
    --zlm-border-radius: 8px;
    --zlm-padding: 12px 20px;
    --zlm-font-size: 16px;
    --zlm-shadow: 0 2px 5px rgba(139, 69, 19, 0.3);
    --zlm-shadow-hover: 0 4px 12px rgba(139, 69, 19, 0.4);
}

/* Theme Integration Classes */
.theme-zum-loewen .zlm-menu-link {
    background: linear-gradient(135deg, var(--primary-color, #8B4513) 0%, var(--primary-hover, #A0522D) 100%);
}

.theme-zum-loewen .zlm-menu-link:hover {
    background: linear-gradient(135deg, var(--primary-hover, #A0522D) 0%, var(--accent-color, #CD853F) 100%);
}

/* Accessibility Improvements */
.zlm-menu-link:focus-visible {
    outline: 3px solid var(--focus-color, #005fcc);
    outline-offset: 2px;
}

/* Tooltip for File Size */
.zlm-menu-link[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.zlm-menu-link[title]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

/* Error State */
.zlm-menu-link.error {
    background: #dc3545;
    pointer-events: none;
    opacity: 0.6;
}

.zlm-menu-link.error::before {
    content: "⚠️";
}

/* Success Animation */
.zlm-menu-link.downloaded {
    animation: zlm-downloaded 0.6s ease;
}

@keyframes zlm-downloaded {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}