/* Custom styles for Flask Pokemon Cards app */

/* Card Grid Layout */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 80px 40px;
    transform-style: preserve-3d;
    max-width: 1400px;
    margin: 60px auto;
    padding: 40px;
    position: relative;
}

/* Responsive grid - 3 columns on desktop */
@media screen and (min-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 2 columns on tablets */
@media screen and (min-width: 768px) and (max-width: 1199px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 60px 30px;
    }
}

/* Single column on mobile */
@media screen and (max-width: 767px) {
    .card-grid {
        grid-template-columns: 1fr;
        grid-gap: 50px 20px;
        padding: 20px;
    }
}

/* Ensure cards have proper spacing and centering */
.card-grid .card {
    margin: 0 auto;
    max-width: 340px;
    width: 100%;
}

/* Section spacing */
main h2 {
    margin-top: 80px;
    margin-bottom: 20px;
    padding: 20px;
    clear: both;
}

main h2:first-of-type {
    margin-top: 40px;
}

main p {
    max-width: 900px;
    margin: 0 auto 30px;
    padding: 0 20px;
    line-height: 1.6;
}

main h3 {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Showcase card */
.showcase {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
}

/* Header spacing */
header {
    padding-bottom: 40px;
}

.intro {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
}

.info {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.back-to-top a {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-to-top a:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
}

/* Active card z-index fix */
.card-grid.active {
    z-index: 99;
    isolation: isolate;
}

/* Card hover state - ensure proper z-index */
.card.interacting {
    z-index: 10;
}

.card.active {
    z-index: 100;
}

/* Improve card visibility in grid */
.card {
    position: relative;
    isolation: isolate;
}

/* Ensure cards don't overlap when not interacting */
.card-grid {
    align-items: start;
}

/* Add some breathing room */
body {
    padding-bottom: 80px;
}

/* Style adjustments for better presentation */
h1 {
    margin: 40px 0 20px;
}

h2 a {
    color: inherit;
    text-decoration: none;
}

h2 a:hover {
    text-decoration: underline;
}

mark {
    background: linear-gradient(120deg, #ffd70080 0%, #ff547080 100%);
    padding: 2px 4px;
    border-radius: 3px;
}

