/* ===============================
   Card Menu - Bootstrap Cards Enhancement
   Professional Version für packeisen2026fluid
   =============================== */

.card-menu-container {
    margin: 2rem 0;
}

/* Card Grid */
.card-menu-grid {
    margin-bottom: 2rem;
}

/* ===============================
   Card Base Styling
   =============================== */

.card-menu-item {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: #fff;
    height: 100%;
}

/* Card Image */
.card-menu-item .card-img-top {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.card-img-link {
    display: block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.card-img-link:hover .card-img-top {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Image Placeholder */
.card-img-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #f1ce73 0%, #fbe299 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.3;
}

/* ===============================
   Card Body
   =============================== */

.card-menu-item .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Card Title */
.card-menu-item .card-title {
    color: #3f170e;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.card-menu-item .card-title a {
    color: #3f170e;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-menu-item .card-title a:hover {
    color: #b85b28;
}

/* Card Text */
.card-menu-item .card-text {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ===============================
   Card Styles (Varianten)
   =============================== */

/* Standard */
.card-style-default {
    border: 1px solid #d3a84a;
}

/* Mit Schatten */
.card-style-shadow {
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Mit Rand */
.card-style-border {
    border: 2px solid #d3a84a;
}

/* Schatten & Hover-Effekt (Empfohlen) */
.card-style-shadow-hover {
    border: 1px solid rgba(211, 168, 74, 0.3);
    box-shadow: 0 2px 8px rgba(63, 23, 14, 0.08);
}

.card-style-shadow-hover:hover {
    box-shadow: 0 8px 20px rgba(63, 23, 14, 0.15);
    transform: translateY(-5px);
    border-color: #d3a84a;
}

/* ===============================
   Button Styling
   =============================== */

.card-menu-item .btn {
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.card-menu-item .btn-outline-primary {
    color: #b85b28;
    border-color: #b85b28;
    background-color: transparent;
}

.card-menu-item .btn-outline-primary:hover {
    background-color: #b85b28;
    border-color: #b85b28;
    color: #fff;
    transform: translateX(5px);
}

/* Stretched Link Fix für Button */
.card-menu-item .stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* ===============================
   Responsive Breakpoints
   =============================== */

/* Large Desktop (4 Spalten möglich) */
@media (min-width: 1400px) {
    .row-cols-lg-4 > * {
        flex: 0 0 auto;
        width: 25%;
    }
}

/* Desktop (3 Spalten Standard) */
@media (min-width: 992px) {
    .card-menu-item .card-img-top {
        height: 220px;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .card-menu-item .card-img-top {
        height: 200px;
    }
    
    .card-menu-item .card-body {
        padding: 1.25rem;
    }
    
    /* Tablet: immer 2 Spalten */
    .row-cols-md-2 > * {
        width: 50%;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .card-menu-container {
        margin: 1.5rem 0;
    }
    
    .card-menu-item .card-img-top {
        height: 180px;
    }
    
    .card-menu-item .card-body {
        padding: 1rem;
    }
    
    .card-menu-grid {
        gap: 1rem !important;
    }
    
    /* Mobile: 1 Spalte */
    .row-cols-1 > * {
        width: 100%;
    }
    
    .card-menu-item .btn {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }
}

/* ===============================
   Backend Preview
   =============================== */

.card-menu-container .alert-warning {
    margin: 1rem;
    padding: 1rem;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
}

.card-menu-container .alert-warning small {
    display: block;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* ===============================
   Accessibility
   =============================== */

.card-menu-item:focus-within {
    outline: 2px solid #b85b28;
    outline-offset: 2px;
}

.card-menu-item a:focus {
    outline: 2px solid #b85b28;
    outline-offset: 2px;
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===============================
   Print Styles
   =============================== */

@media print {
    .card-menu-item {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .card-menu-item .btn {
        display: none;
    }
    
    .card-menu-item:hover {
        transform: none !important;
    }
}

/* ===============================
   Loading State (Optional)
   =============================== */

.card-menu-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.card-menu-item.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f1ce73;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===============================
   Hover Effects Enhanced
   =============================== */

.card-menu-item .card-img-top {
    transition: transform 0.3s ease;
}

.card-style-shadow-hover:hover .card-img-top {
    transform: scale(1.05);
}

.card-style-shadow-hover:hover .card-title a {
    color: #b85b28;
}

/* ===============================
   Dark Mode Support (Optional)
   =============================== */

@media (prefers-color-scheme: dark) {
    .card-menu-item {
        background-color: #2d2d2d;
        border-color: #4a4a4a;
    }
    
    .card-menu-item .card-title,
    .card-menu-item .card-title a {
        color: #f1ce73;
    }
    
    .card-menu-item .card-text {
        color: #ccc;
    }
    
    .card-img-placeholder {
        background: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%);
    }
}
