/* Base Styles */
body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #eceff1, #b0bec5); /* Gradient background */
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

header, footer {
    text-align: center;
    padding: 1em;
    background-color: #2c3e50;
    color: #ffffff;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    background: linear-gradient(90deg, #e57373, #81c784, #64b5f6);
    background-size: 200%;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradientShift 5s infinite linear;
}

header p {
    font-size: 1.2em;
    color: #bdc3c7;
}

/* Dashboard Container with Animation */
#dashboard-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive grid */
    gap: 20px;
    padding: 20px;
    animation: fadeIn 1.2s ease-in-out; /* Dashboard entry animation */
}

/* Card Container and Styling */
.card-container {
    width: 300px;
    margin: 15px;
}

.card {
    width: 100%;
    height: 400px;
    perspective: 1000px;
    margin: 10px auto;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    position: relative;
}

.card:hover .card-inner {
    transform: rotateY(180deg);
}

/* Card Front and Back Styling */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-radius: 8px;
    text-align: center;
}

.card-back {
    transform: rotateY(180deg);
    background-color: #2c3e50;
    color: white;
}

/* Ensure images cover the card uniformly */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Floating Caption Overlay */
.verdict-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 1em;
    text-align: center;
    padding: 5px 0;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-radius: 0 0 8px 8px;
}

.show-caption {
    transform: translateY(0);
    opacity: 1;
}

/* Enhanced Glowing Border */
.card-back.verdict-faithful {
    box-shadow: 0px 0px 20px 5px #4CAF50;
}
.card-back.verdict-altered {
    box-shadow: 0px 0px 20px 5px #FFC107;
}
.card-back.verdict-mismatched {
    box-shadow: 0px 0px 20px 5px #F44336;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease-in-out;
}

.close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    #dashboard-container {
        grid-template-columns: 1fr; /* Stacks cards on smaller screens */
    }
    .card {
        width: 100%;
    }
    #details-container {
        padding: 10px;
    }
    .modal-content {
        width: 90%;
    }
}

/* Keyframe Animation for Gradient Shift */
@keyframes gradientShift {
    0% {
        background-position: 0%;
    }
    100% {
        background-position: 200%;
    }
}

/* Fade-In Animation for Dashboard */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
