/* Katalog Page Styles */

.katalog-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    border-radius: 10px;
    margin-bottom: 40px;
}

.katalog-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
}

.katalog-header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.95;
}

.katalog-container {
    margin-bottom: 40px;
    max-width: 100%;
    overflow-x: hidden;
}

.katalog-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    max-width: 100%;
}

.search-box,
.category-filter {
    padding: 12px 15px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    background: var(--panel-bg);
    color: var(--text);
    font-size: 1em;
    transition: all 0.3s ease;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box:focus,
.category-filter:focus {
    outline: none;
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(160, 112, 77, 0.1);
}

.category-filter {
    min-width: 150px;
    cursor: pointer;
}

/* Dark Mode */
.dark .search-box,
.dark .category-filter,
.dark .page-selector {
    background: var(--panel-bg);
    border-color: var(--accent);
}

.page-selector {
    padding: 12px 15px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    background: var(--panel-bg);
    color: var(--text);
    font-size: 1em;
    transition: all 0.3s ease;
    min-width: 140px;
    cursor: pointer;
}

.page-selector:focus {
    outline: none;
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(160, 112, 77, 0.1);
}

.katalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.mushroom-card {
    background: var(--panel-bg);
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    word-break: break-word;
    position: relative;
}

.mushroom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent-strong);
}

/* In Collection Styling */
.mushroom-card.in-collection {
    border: 2px solid #2e7d32;
    box-shadow: 0 0 0 1px #2e7d32, inset 0 0 0 1px #2e7d32;
    animation: borderGlowBottom 0.6s ease-out forwards;
}

.mushroom-card.in-collection:hover {
    border-color: #1b5e20;
    box-shadow: 0 0 0 1px #1b5e20, 0 10px 30px rgba(46, 125, 50, 0.3);
}

.dark .mushroom-card.in-collection {
    border: 2px solid #4caf50;
    box-shadow: 0 0 0 1px #4caf50, inset 0 0 0 1px #4caf50;
    animation: borderGlowBottomDark 0.6s ease-out forwards;
}

.dark .mushroom-card.in-collection:hover {
    border-color: #66bb6a;
    box-shadow: 0 0 0 1px #66bb6a, 0 10px 30px rgba(79, 195, 247, 0.3);
}

.collection-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
    animation: slideIn 0.3s ease-out;
}

.dark .collection-badge {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

@keyframes borderGlowBottom {
    from {
        border-color: rgba(46, 125, 50, 0);
        box-shadow: 0 0 0 1px rgba(46, 125, 50, 0), inset 0 0 0 1px rgba(46, 125, 50, 0);
    }
    to {
        border-color: #2e7d32;
        box-shadow: 0 0 0 1px #2e7d32, inset 0 0 0 1px #2e7d32;
    }
}

@keyframes borderGlowBottomDark {
    from {
        border-color: rgba(76, 175, 80, 0);
        box-shadow: 0 0 0 1px rgba(76, 175, 80, 0), inset 0 0 0 1px rgba(76, 175, 80, 0);
    }
    to {
        border-color: #4caf50;
        box-shadow: 0 0 0 1px #4caf50, inset 0 0 0 1px #4caf50;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mushroom-card h3 {
    margin: 0 0 10px 0;
    color: var(--accent);
    font-size: 1.3em;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.mushroom-card p {
    margin: 8px 0;
    color: var(--text);
    line-height: 1.5;
    font-size: 0.95em;
}

.mushroom-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--accent);
}

.mushroom-tag {
    display: inline-block;
    padding: 5px 12px;
    margin: 5px 5px 5px 0;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.tag-giftig {
    background: #ffebee;
    color: #c62828;
}

.dark .tag-giftig {
    background: #4a1a1a;
    color: #ff6b6b;
}

.tag-ungiftig {
    background: #e8f5e9;
    color: #2e7d32;
}

.dark .tag-ungiftig {
    background: #1a4a1a;
    color: #81c784;
}

.tag-speisepilz {
    background: #f3e5f5;
    color: #6a1b9a;
}

.dark .tag-speisepilz {
    background: #3a1a4a;
    color: #ce93d8;
}

.placeholder-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text);
}

.placeholder-message p {
    margin: 0;
    font-size: 1.2em;
}

.katalog-info {
    background: var(--panel-bg);
    padding: 30px;
    border-radius: 10px;
    border-left: 5px solid var(--accent);
}

.katalog-info h2 {
    margin-top: 0;
    color: var(--accent);
}

.katalog-info p {
    line-height: 1.6;
    color: var(--text);
}

.info-box {
    background: rgba(160, 112, 77, 0.1);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    color: var(--text);
    border-left: 4px solid var(--accent-strong);
}

.dark .info-box {
    background: rgba(160, 112, 77, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .katalog-header h1 {
        font-size: 2em;
    }

    .katalog-filters {
        flex-direction: column;
        padding: 0 10px;
    }

    .search-box,
    .category-filter {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .katalog-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .katalog-header {
        padding: 30px 15px;
    }

    .katalog-header h1 {
        font-size: 1.5em;
    }

    .katalog-header p {
        font-size: 1em;
    }

    .katalog-info {
        padding: 20px;
    }
}

/* ===== CARD ENHANCEMENTS ===== */

.mushroom-card-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.mushroom-latin {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 8px;
}

.mushroom-preview {
    font-size: 0.9em;
    color: var(--text);
    line-height: 1.5;
    min-height: 60px;
}

.mushroom-card-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed var(--accent);
}

.view-details {
    color: var(--accent-strong);
    font-size: 0.9em;
    font-weight: 600;
    transition: color 0.2s ease;
}

.mushroom-card:hover .view-details {
    color: var(--accent);
}

/* ===== PAGINATION ===== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
    padding: 20px;
    background: var(--panel-bg);
    border-radius: 10px;
    border: 2px solid var(--accent);
}

.pagination-btn {
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent-strong);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    background: var(--panel-bg);
    color: var(--text-secondary);
    cursor: not-allowed;
    border: 2px solid var(--accent);
    opacity: 0.5;
}

.pagination-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.pagination-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination-current {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--accent-strong);
}

.pagination-total {
    font-size: 0.9em;
    color: var(--text);
}

.pagination-count {
    font-size: 0.85em;
    color: var(--text-secondary);
}

#paginationPageSelector {
    padding: 12px 15px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    background: var(--panel-bg);
    color: var(--text);
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
}

#paginationPageSelector:hover {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(160, 112, 77, 0.1);
}

#paginationPageSelector:focus {
    outline: none;
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(160, 112, 77, 0.1);
}

/* ===== FUNGI MODAL ===== */

.fungi-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--panel-bg);
    border-radius: 15px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 3px solid var(--accent);
    animation: modalSlideIn 0.3s ease;
    box-sizing: border-box;
    transition: all 0.3s ease;
    z-index: 2;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    background: var(--panel-bg);
    border: 2px solid var(--accent-strong);
    border-radius: 50%;
    font-size: 2em;
    color: var(--accent-strong);
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s, background 0.2s, border 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background-clip: padding-box;
    outline: none;
}

.modal-close:focus {
    outline: 2px solid var(--accent-strong);
}

.modal-close:hover {
    color: #fff;
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.modal-body {
    padding: 30px;
    padding-top: 50px;
    transition: padding 0.3s ease;
}

.modal-loading {
    text-align: center;
    padding: 60px 20px;
}

.modal-loading .loading-spinner {
    margin: 0 auto 20px;
}

.modal-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--text);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 20px;
    flex-wrap: wrap;
    transition: all 0.3s ease;
}
@media (max-width: 768px) {
    .modal-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 10px;
        padding-bottom: 15px;
    }
    .modal-icon {
        font-size: 2em;
        margin-bottom: 0;
    }
    .modal-edibility {
        align-self: center;
        margin-top: 10px;
    }
    .modal-titles {
        text-align: center;
    }
    .modal-titles h2 {
        margin-bottom: 5px;
    }
    .modal-latin,
    .modal-english {
        margin: 3px 0;
    }
}

.modal-icon {
    font-size: 3em;
    transition: font-size 0.3s ease;
}

.modal-titles {
    flex: 1;
    min-width: 200px;
    transition: all 0.3s ease;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    display: flex;
    flex-direction: column;
}

.modal-titles h2 {
    margin: 0 0 5px 0;
    color: var(--accent-strong);
    font-size: 1.8em;
    transition: font-size 0.3s ease;
}

.modal-latin {
    font-style: italic;
    color: var(--text-secondary);
    margin: 0;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.modal-english {
    color: var(--text);
    margin: 5px 0 0 0;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.modal-edibility-row {
    margin-bottom: 20px;
}

.modal-edibility {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1em;
    white-space: nowrap;
    align-self: flex-end;
    margin-top: 30px;
    transition: all 0.3s ease;
}

.edibility-toxic {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #c62828;
}

.dark .edibility-toxic {
    background: #4a1a1a;
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.edibility-edible {
    background: #f3e5f5;
    color: #6a1b9a;
    border: 2px solid #6a1b9a;
}

.dark .edibility-edible {
    background: #3a1a4a;
    color: #ce93d8;
    border-color: #ce93d8;
}

.edibility-safe {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #2e7d32;
}

.dark .edibility-safe {
    background: #1a4a1a;
    color: #81c784;
    border-color: #81c784;
}

.edibility-unknown {
    background: #fff8e1;
    color: #f57c00;
    border: 2px solid #f57c00;
}

.dark .edibility-unknown {
    background: #4a3a1a;
    color: #ffb74d;
    border-color: #ffb74d;
}

.warning-box {
    background: #fff3e0;
    border: 2px solid #ff9800;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    color: #e65100;
    font-size: 1em;
}

.dark .warning-box {
    background: #4a2a0a;
    border-color: #ffb74d;
    color: #ffcc80;
}

.modal-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-section {
    background: rgba(160, 112, 77, 0.08);
    border-radius: 10px;
    padding: 20px;
}

.dark .modal-section {
    background: rgba(160, 112, 77, 0.15);
}

.modal-section h3 {
    margin: 0 0 12px 0;
    color: var(--accent-strong);
    font-size: 1.1em;
}

.modal-section p {
    margin: 0;
    color: var(--text);
    line-height: 1.7;
}

.modal-sources ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.modal-sources li {
    margin: 8px 0;
}

.modal-sources a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.modal-sources a:hover {
    text-decoration: underline;
    color: var(--accent-strong);
}

/* Loading spinner */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== RESPONSIVE FOR NEW ELEMENTS ===== */

@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-btn {
        width: 100%;
    }
    
    .modal-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 10px;
        padding-bottom: 15px;
    }
    
    .modal-icon {
        font-size: 2em;
        margin-bottom: 0;
    }
    
    .modal-edibility {
        align-self: center;
        margin-top: 10px;
    }
    
    .modal-titles {
        text-align: center;
    }
    
    .modal-titles h2 {
        margin-bottom: 5px;
    }
    
    .modal-latin,
    .modal-english {
        margin: 3px 0;
    }
}

@media (max-width: 480px) {
    .modal-content {
        max-height: 95vh;
        margin: 5px;
        border-radius: 10px;
        border-width: 2px;
    }
    
    .modal-body {
        padding: 15px;
        padding-top: 45px;
    }
    
    .modal-header {
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    .modal-icon {
        font-size: 1.8em;
    }
    
    .modal-titles h2 {
        font-size: 1.2em;
        word-break: break-word;
    }
    
    .modal-latin {
        font-size: 0.9em;
    }
    
    .modal-section {
        padding: 12px;
    }
    
    .modal-section p {
        font-size: 0.95em;
    }
    
    .modal-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 1.2em;
    }
    
    .modal-edibility {
        padding: 6px 12px;
        font-size: 0.85em;
        margin-top: 8px;
    }
    
    .fungi-modal {
        padding-top: 60px;
    }
}
