.horse-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px; /* Platz für die fixierte Navigation */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.horse-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-weight: 500;
}

.back-button:hover {
    background-color: #e0e0e0;
    transform: translateX(-2px);
}

.horse-detail-header h1 {
    margin: 0;
    font-size: 2em;
    color: #333;
}

.horse-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.main-image-container {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-image-container img,
.main-image-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.horse-detail-additional {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.gallery-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gallery-section h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Masonry Layout für die Bildergalerie */
.image-thumbnails {
    column-count: 4; /* Standardmäßig 4 Spalten */
    column-gap: 15px;
}

/* NEUE VERBESSERTE MEDIA-GALERIE */
.main-media-display {
    margin-bottom: 30px;
    background-color: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.main-video-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-video {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 8px;
}

.main-image-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.main-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 8px;
}

.video-controls-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px 15px 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.video-info {
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.video-info .material-icons {
    font-size: 18px;
}

.video-format-info {
    background-color: rgba(255,255,255,0.9);
    color: #333;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

/* NEUE THUMBNAIL-GALERIE */
.media-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.media-thumbnail {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    background-color: #f8f9fa;
}

.media-thumbnail:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.media-thumbnail.active {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.video-thumbnail-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
}

.video-poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.video-placeholder .material-icons {
    font-size: 40px;
    opacity: 0.8;
}

.thumbnail-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.media-thumbnail:hover .video-overlay {
    background-color: rgba(0,0,0,0.5);
    opacity: 1;
}

.video-overlay .material-icons {
    font-size: 48px;
    margin-bottom: 4px;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Video-Duration Text entfernt - nur noch Play-Icon */
.video-duration {
    display: none;
}

.main-media-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #FF9800;
    color: white;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    width: 24px;
    height: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.main-media-badge .material-icons {
    font-size: 14px;
}

/* LEGACY THUMBNAIL SUPPORT */
.thumbnail {
    break-inside: avoid; /* Verhindert, dass Elemente zwischen Spalten geteilt werden */
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    display: inline-block;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 3px solid transparent;
    position: relative;
}

.thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.thumbnail.selected {
    border-color: #4CAF50;
}

/* Hauptbild im Masonry-Layout */
.thumbnail.main-thumbnail {
    border-color: #4CAF50;
    position: relative;
}

.main-image-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #4CAF50;
    color: white;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    width: 24px;
    height: 24px;
}

.main-image-badge .material-icons {
    font-size: 16px;
}

.thumbnail img,
.thumbnail video {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive Design für die Thumbnail-Galerie */
@media (max-width: 1200px) {
    .media-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .image-thumbnails {
        column-count: 3;
    }
}

@media (max-width: 992px) {
    .media-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .main-video-container,
    .main-image-container {
        min-height: 300px;
    }
    
    .image-thumbnails {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .media-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
    
    .main-video-container,
    .main-image-container {
        min-height: 250px;
    }
    
    .image-thumbnails {
        column-count: 1;
    }
}

.horse-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-section h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9em;
}

.info-value {
    color: #333;
    font-size: 1.1em;
}

.pedigree {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pedigree-father,
.pedigree-mother,
.pedigree-father-father,
.pedigree-father-mother,
.pedigree-mother-father,
.pedigree-mother-mother {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pedigree-father:last-child,
.pedigree-mother:last-child,
.pedigree-father-father:last-child,
.pedigree-father-mother:last-child,
.pedigree-mother-father:last-child,
.pedigree-mother-mother:last-child {
    border-bottom: none;
}

.pedigree strong {
    color: #666;
    margin-right: 8px;
}

.description {
    line-height: 1.6;
    color: #444;
}

.horse-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.horse-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.edit-button {
    background-color: #4CAF50;
    color: white;
}

.edit-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.delete-button {
    background-color: #f44336;
    color: white;
}

.delete-button:hover {
    background-color: #da190b;
    transform: translateY(-2px);
}

.horse-actions .material-icons {
    font-size: 1.4rem;
}

.horse-detail-header .horse-actions {
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}

.horse-detail-header .horse-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.horse-detail-header .edit-button {
    background-color: #4CAF50;
    color: white;
}

.horse-detail-header .edit-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.horse-detail-header .delete-button {
    background-color: #f44336;
    color: white;
}

.horse-detail-header .delete-button:hover {
    background-color: #da190b;
    transform: translateY(-2px);
}

.horse-detail-header .horse-actions .material-icons {
    font-size: 1.4rem;
}

@media (max-width: 768px) {
    .horse-detail {
        padding: 15px;
        padding-bottom: 120px; /* Mehr Platz für Mobile-Navigation */
    }
    
    .horse-detail-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .horse-detail-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .horse-detail-header .horse-actions {
        justify-content: center;
        margin-top: 15px;
        gap: 10px;
    }

    .horse-detail-header .horse-actions button {
        flex: 1;
        max-width: 120px;
    }

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

    .horse-actions {
        flex-direction: column;
    }

    .horse-actions button {
        width: 100%;
    }
}

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    padding: 40px;
    height: 100%;
}

.no-image .material-icons {
    font-size: 48px;
    margin-bottom: 10px;
    color: #ccc;
}

.horse-info-basic {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.horse-info-basic .info-section {
    height: 100%;
} 