/* 3D Card Component Styles */

.card-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    padding: 20px;
}

.card-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-in-out;
    cursor: pointer;
    transform: rotateX(5deg) rotateY(-5deg) translateZ(0px);
}

/* Card Sizes */
.card-size-small {
    width: 120px;
    height: 168px;
}

.card-size-medium {
    width: 200px;
    height: 280px;
}

.card-size-large {
    width: 280px;
    height: 392px;
}

/* Dramatic Animation States */
.card-3d.dissolving-out {
    transform: rotateX(15deg) rotateY(-5deg) rotateZ(-8deg) translateY(-40px) translateZ(-150px) scale(0.7);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 25px 40px rgba(0, 0, 0, 0.4);
}

.card-3d.dissolving-in {
    transform: rotateX(-10deg) rotateY(-5deg) rotateZ(5deg) translateY(60px) translateZ(-150px) scale(1.1);
    opacity: 0.5;
    transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-3d.flipped {
    transform: rotateX(5deg) rotateY(-5deg) rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    transition: box-shadow 0.3s ease;
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Placeholder styles */
.card-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #6c757d;
    text-align: center;
    padding: 20px;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.placeholder-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Front side content */
.card-content-front {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.card-image img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-info {
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
}

.card-type {
    font-size: 0.75rem;
    color: #437c62;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.card-name {
    font-size: 1rem;
    font-weight: bold;
    color: #212529;
    margin-bottom: 4px;
    line-height: 1.2;
}

.card-scientific {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    margin-bottom: 4px;
}

.card-family {
    font-size: 0.75rem;
    color: #495057;
    font-weight: 500;
}

/* Back side content */
.card-content-back {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.4;
}

.card-detail {
    margin-bottom: 12px;
}

.card-detail strong {
    color: #437c62;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.card-detail p,
.card-detail span {
    color: #495057;
    margin: 0;
}

/* Flip button */
.flip-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(67, 124, 98, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    z-index: 10;
}

.flip-button:hover {
    background: rgba(67, 124, 98, 1);
    transform: scale(1.1);
}

.flip-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.flip-button:hover .flip-icon {
    transform: rotate(180deg);
}

/* Responsive design */
@media (max-width: 768px) {
    .card-size-small {
        width: 100px;
        height: 140px;
    }
    
    .card-size-medium {
        width: 160px;
        height: 224px;
    }
    
    .card-size-large {
        width: 220px;
        height: 308px;
    }
    
    .card-image img {
        max-height: 80px;
    }
    
    .card-info {
        padding: 12px;
    }
    
    .card-content-back {
        padding: 15px;
        font-size: 0.75rem;
    }
    
    .placeholder-icon {
        font-size: 2rem;
    }
    
    .placeholder-text {
        font-size: 0.8rem;
    }
}

/* Remove old animation */
@keyframes cardDraw {
    0% {
        transform: rotateX(5deg) rotateY(-5deg) translateY(20px) scale(0.9);
        opacity: 0.7;
    }
    50% {
        transform: rotateX(5deg) rotateY(-5deg) rotateZ(5deg) scale(0.95);
    }
    100% {
        transform: rotateX(5deg) rotateY(-5deg) translateY(0) scale(1);
        opacity: 1;
    }
}

.card-3d.drawing {
    animation: cardDraw 0.3s ease-in-out;
}

/* Sightings Cards Layout */
.sightings-cards-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.sighting-card-wrapper {
    flex: 0 0 auto;
}

.sighting-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.sighting-image img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.image-placeholder {
    font-size: 2rem;
    color: #6c757d;
    opacity: 0.7;
}

.sighting-info {
    padding: 10px;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
}

.sighting-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #212529;
    margin-bottom: 3px;
    line-height: 1.2;
}

.sighting-scientific {
    font-size: 0.7rem;
    color: #6c757d;
    font-style: italic;
    margin-bottom: 5px;
}

.sighting-detail {
    margin-bottom: 8px;
    font-size: 0.7rem;
}

.sighting-detail strong {
    color: #437c62;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.sighting-detail p {
    color: #495057;
    margin: 0;
    line-height: 1.3;
}

/* Loading and error states */
.loading, .no-sightings, .error-message {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.no-sightings p, .error-message p {
    margin: 10px 0;
}

.error-message .btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #437c62;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.error-message .btn:hover {
    background: #356049;
}