/* /styles/cards.css */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Lato:wght@400;700&display=swap');

body {
    font-family: 'Lato', sans-serif; /* Default body font */
    /* Backgrounds are set per page for theme */
}

.font-title {
    font-family: 'Merriweather', serif;
}

.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-width: 3px; /* Base border width for cards */
    position: relative; /* For pseudo-elements used in animations */
    overflow: hidden; /* Keep animations contained */
}

.card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 20px -4px rgba(0,0,0,0.15), 0 6px 8px -3px rgba(0,0,0,0.1);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-thumb {
    background-color: #a3a3a3; /* neutral-400 */
    border-radius: 4px;
}
::-webkit-scrollbar-track {
    background-color: #e5e5e5; /* neutral-200 */
}

.modal-content-container {
    max-height: 90vh;
    overflow-y: auto;
    border-width: 4px; /* Modal border */
}

.mana-symbol-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem; /* 20px */
    height: 1.25rem; /* 20px */
    border-radius: 50%;
    font-size: 0.75rem; /* 12px */
    font-weight: bold;
    margin-right: 0.25rem; /* 4px */
    color: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.mana-symbol-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem; /* 28px */
    height: 1.75rem; /* 28px */
    border-radius: 50%;
    font-size: 1rem; /* 16px */
    font-weight: bold;
    margin-right: 0.25rem; /* 4px */
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Card Image Placeholder in Modal */
.modal-image-container {
    width: 100%;
    max-width: 256px; /* Max width for the image */
    aspect-ratio: 1 / 1; /* Enforce square shape */
    margin-left: auto;
    margin-right: auto;
    background-color: #e5e7eb; /* gray-200 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem; /* rounded-lg */
    overflow: hidden; /* Ensure image fits */
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the square area */
}

/* Rarity Styling */
.rarity-common {
    border-color: #a3a3a3; /* neutral-400 */
}

.rarity-uncommon {
    border-color: #22c55e; /* green-500 */
    box-shadow: 0 0 5px #22c55e, 0 0 8px #22c55e33;
}

.rarity-rare {
    border-color: #3b82f6; /* blue-500 */
    box-shadow: 0 0 8px #3b82f6, 0 0 12px #3b82f633;
    animation: pulse-rare 3s infinite ease-in-out;
}

.rarity-epic {
    border-color: #a855f7; /* purple-500 */
    box-shadow: 0 0 12px #a855f7, 0 0 18px #a855f733;
    animation: pulse-epic 2.5s infinite ease-in-out, shimmer-epic 4s infinite linear;
    position: relative; /* Needed for pseudo-element shimmer */
}

.rarity-epic::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px; /* Slightly outside the border */
    border-radius: inherit; /* Match card's border-radius */
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer-line-epic 4s infinite linear;
    z-index: 1; /* Above card content but below hover effects if any */
    pointer-events: none;
}


@keyframes pulse-rare {
    0%, 100% { box-shadow: 0 0 8px #3b82f6, 0 0 12px #3b82f633; }
    50% { box-shadow: 0 0 12px #3b82f6bb, 0 0 18px #3b82f655; }
}

@keyframes pulse-epic {
    0%, 100% { box-shadow: 0 0 12px #a855f7, 0 0 18px #a855f733; }
    50% { box-shadow: 0 0 18px #a855f7bb, 0 0 25px #a855f755; }
}

/* Shimmer effect for Epic cards */
@keyframes shimmer-epic {
    0% {
        background-image: linear-gradient(100deg,
            rgba(168, 85, 247, 0.1) 0%,
            rgba(168, 85, 247, 0.3) 10%,
            rgba(168, 85, 247, 0.1) 20%);
        background-size: 300% 100%;
        background-position: 100% 0;
    }
    100% {
        background-image: linear-gradient(100deg,
            rgba(168, 85, 247, 0.1) 0%,
            rgba(168, 85, 247, 0.3) 10%,
            rgba(168, 85, 247, 0.1) 20%);
        background-size: 300% 100%;
        background-position: -100% 0;
    }
}

@keyframes shimmer-line-epic {
  0% { transform: translateX(-100%) skewX(-20deg); }
  100% { transform: translateX(100%) skewX(-20deg); }
}

/* Improved Modal Layout */
.modal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem; /* mb-3 */
}
.modal-card-name {
    font-size: 1.75rem; /* text-2xl originally, slightly larger */
    line-height: 2.2rem;
    font-weight: 700;
}
.modal-card-type-rarity {
    margin-top: 0.5rem; /* mt-2 */
    margin-bottom: 0.75rem; /* mb-3 */
    font-size: 0.875rem; /* text-sm */
}
.modal-card-rules {
    margin-top: 0.75rem; /* mt-3 */
    margin-bottom: 0.75rem; /* mb-3 */
    font-size: 0.95rem; /* slightly larger for readability */
    line-height: 1.4;
}
.modal-card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.125rem; /* text-lg */
    margin-top: 0.5rem; /* mt-2 */
}
.modal-card-flavor {
    font-style: italic;
    margin-top: 0.75rem; /* mt-3 */
    font-size: 0.875rem; /* text-sm */
}

/* Small card layout adjustments for consistency */
.small-card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.small-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem; /* mb-2 */
}
.small-card-name {
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25rem; /* leading-tight */
    font-weight: bold;
}
.small-card-art-container {
    margin-top: 0.5rem; /* my-2 */
    margin-bottom: 0.5rem; /* my-2 */
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.25rem; /* rounded-sm or similar */
}
.small-card-type-rarity {
    font-size: 0.75rem; /* text-xs */
    margin-top: 0.25rem; /* mt-1 */
    margin-bottom: 0.5rem; /* mb-2 */
}
.small-card-rules {
    font-size: 0.75rem; /* text-xs */
    line-height: 1.25; /* leading-snug */
    margin-bottom: 0.5rem; /* mb-2 */
    flex-grow: 1; /* Allow rules text to take space */
    min-height: 3em; /* Ensure some space for rules */
}
.small-card-stats {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto; /* Pushes to bottom */
    padding-top: 0.25rem; /* pt-1 */
}
.small-card-stats-badge {
    font-weight: bold;
    font-size: 0.875rem; /* text-sm */
    padding: 0.125rem 0.5rem; /* px-2 py-0.5 */
    border-radius: 0.25rem; /* rounded */
}

/* Specific element background/text classes (can be generated by JS or be here) */
/* Example: .element-bg-Heart { background-color: #ef4444; } .element-text-Heart { color: #fef2f2; } */
/* These are already handled by Tailwind in the JS, so keeping them dynamic is fine */

