/* General body styling */
body {
    background-color: #f0f2f5;
    color: #1c1e21;
    font-family: 'Inter', sans-serif;
    overscroll-behavior-y: none; /* Prevents pull-to-refresh gestures on mobile */
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Add a smooth scroll behavior to the root element */
html {
    scroll-behavior: smooth;
}

/* Ensure the main content area is allowed to scroll */
main {
    overflow-y: auto; /* Changed from 'hidden' to 'auto' */
    width: calc(100vw - 256px);
    flex: 1;
}

/* Fix for main content area width issue */
.flex-1.flex.flex-col.overflow-hidden {
    flex: 1;
    width: auto;
    min-width: 0; /* Allows flex items to shrink below their content size */
}

/* Fix for tab navigation width issue */
.mb-6.border-b.border-gray-200.dark\\:border-gray-700 {
    width: 100%;
}

nav[aria-label="Tabs"] {
    width: 100%;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    /* Styles for mobile devices */
    body {
        -webkit-text-size-adjust: 100%; /* Prevents iOS font scaling */
    }
}

/* --- Skeleton Loader Styles --- */
@keyframes pulse {
    50% {
        opacity: .5;
    }
}
.skeleton {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    background-color: #e2e8f0; /* gray-200 */
    border-radius: 0.25rem;
}
.dark .skeleton {
    background-color: #4b5563; /* gray-600 */
}

/* --- Scroll to Top Button --- */
#scroll-to-top-btn {
    transition: opacity 0.3s, transform 0.3s;
}
#scroll-to-top-btn:hover {
    transform: scale(1.1);
}

/* --- Playtest Modal --- */
.playtest-btn {
    @apply px-4 py-2 bg-blue-600 text-white font-semibold rounded-full text-sm shadow-md hover:bg-blue-700 transition-colors;
}

.playtest-zone {
    @apply border-2 border-dashed border-gray-600 relative;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
}

.playtest-card {
    @apply h-28 rounded-md shadow-lg cursor-pointer transition-transform duration-200 hover:scale-105 hover:z-10;
}

#playtest-hand .playtest-card {
    @apply h-32;
}

#playtest-battlefield .playtest-card {
    @apply h-24;
}

/* --- Profile Page Tabs --- */
.profile-tab-button {
    @apply whitespace-nowrap py-4 px-1 border-b-2 font-medium text-lg text-gray-500 hover:text-gray-700 hover:border-gray-300;
}
.profile-tab-button.active {
    @apply text-blue-600 border-blue-600;
}

/* --- NEW: Badge Styles --- */
.badge-item {
    @apply flex flex-col items-center justify-center text-center p-3 bg-gray-100 dark:bg-gray-700 rounded-lg w-24 h-24 transition-transform duration-200 hover:scale-105;
    position: relative;
    cursor: help; /* Indicates more info on hover */
}

.badge-icon {
    @apply text-3xl mb-1;
}

.badge-name {
    @apply text-xs font-semibold text-gray-700 dark:text-gray-200;
}

/* --- Message Bubbles with Headers --- */
#messages-container .message-group {
    @apply mb-4 flex flex-col;
}
#messages-container .message-group.sent {
    @apply items-end;
}
#messages-container .message-group.received {
    @apply items-start;
}
#messages-container .message-header {
    @apply px-1 mb-1;
}
#messages-container .message-bubble {
    @apply p-3 rounded-lg max-w-xs;
}
#messages-container .message-group.sent .message-bubble {
    @apply bg-blue-600 text-white;
}
#messages-container .message-group.received .message-bubble {
    @apply bg-gray-200 text-gray-800;
}

/* --- Conversation List Item --- */
#conversations-list .conversation-item {
    @apply flex items-center p-3 cursor-pointer hover:bg-gray-100 border-b border-gray-200;
}

/* --- Messenger Widget --- */
#messenger-widget {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 350px;
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

#messenger-widget-header {
    background-color: #1d4ed8; /* blue-800 */
    color: white;
    padding: 0.75rem 1rem;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#messenger-widget-body {
    background-color: white;
    height: 400px;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: height 0.3s ease-in-out;
}

#messenger-widget.minimized #messenger-widget-body {
    height: 0;
    padding: 0;
    border: none;
}

/* --- Full Page Messenger --- */
#conversations-list .conversation-item.active {
    @apply bg-blue-50;
}

#messages-container .message {
    @apply mb-4 flex;
}
#messages-container .message.sent {
    @apply justify-end;
}
#messages-container .message.received {
    @apply justify-start;
}

/* Base Styles */
.dark body {
    color: #d1d5db; /* A light gray for better readability in dark mode */
}

/* Header Styles */
.main-header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0.75rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
    border-radius: 0.375rem; /* rounded-md */
}

.logo h1 {
    margin-left: 0.75rem;
    font-size: 1.875rem; /* text-3xl */
    font-weight: 800; /* font-extrabold */
    color: #1a202c; /* gray-800 */
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav li {
    margin-left: 1.5rem; /* space-x-6 */
}

.main-nav a {
    color: #4a5568; /* gray-600 */
    text-decoration: none;
    font-size: 1.25rem; /* text-xl */
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #2563eb; /* blue-600 */
}

.btn {
    padding: 0.5rem 1rem;
    font-weight: 600; /* font-semibold */
    border-radius: 9999px; /* rounded-full */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* shadow-md */
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: #2563eb; /* blue-600 */
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8; /* blue-700 */
}

.btn-secondary {
    background-color: #10b981; /* green-600 */
    color: white;
}

.btn-secondary:hover {
    background-color: #059669; /* green-700 */
}

/* Modal overlay styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; /* <-- THIS IS THE KEY FIX: Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
    display: flex; /* <-- Displayed as flex when 'open' class is added */
}
.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0.75rem; /* rounded-lg */
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); /* shadow-xl */
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay.open .modal-content {
    transform: scale(1);
}
.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4a5568; /* gray-700 */
}

/* Product Card Styles (for shop.html) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem; /* gap-6 */
    padding: 1rem 0;
}

.product-card {
    background-color: #ffffff;
    border-radius: 0.5rem; /* rounded-lg */
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* shadow-md */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0; /* gray-200 */
}

.product-card:hover {
    transform: translateY(-0.25rem); /* -translate-y-1 */
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); /* shadow-lg */
}

.product-card img {
    width: 100%;
    height: 200px; /* Fixed height to control size */
    object-fit: cover; /* Ensures image covers the area without distortion */
    border-bottom: 1px solid #e2e8f0;
}

.product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-info h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #1a202c; /* gray-800 */
    font-size: 1.25rem; /* text-xl */
    font-weight: 700; /* font-bold */
}

.product-info p {
    margin: 0.25rem 0;
    color: #4a5568; /* gray-600 */
    font-size: 0.875rem; /* text-sm */
}

.product-card .price {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 800; /* font-extrabold */
    color: #2563eb; /* blue-600 */
    margin-top: 0.75rem;
}

.product-card .availability {
    font-size: 0.875rem; /* text-sm */
    color: #4a5568; /* gray-700 */
}

.product-card .units-available {
    font-size: 0.875rem; /* text-sm */
    color: #4a5568; /* gray-700 */
}

.product-actions {
    display: flex;
    gap: 0.5rem; /* space-x-2 */
    margin-top: 1rem;
}

.product-actions button {
    flex: 1;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-actions .add-to-cart-btn {
    background-color: #2563eb; /* blue-600 */
    color: white;
}

.product-actions .add-to-cart-btn:hover {
    background-color: #1d4ed8; /* blue-700 */
}

.product-actions .view-more-btn {
    background-color: #e2e8f0; /* gray-200 */
    color: #4a5568; /* gray-700 */
}

.product-actions .view-more-btn:hover {
    background-color: #cbd5e0; /* gray-300 */
}

/* Product Detail Modal Specific Styles (shared with shop.html) */
.product-detail-modal .modal-content {
    max-width: 900px;
}
.product-detail-modal .modal-body {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem; /* gap-8 */
}
.product-detail-modal .product-image-gallery {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.product-detail-modal .product-image-gallery img#modal-main-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 0.5rem; /* rounded-lg */
    margin-bottom: 1rem;
    background-color: #f8fafc; /* gray-50 for transparent images */
}
.product-detail-modal .thumbnail-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* gap-2 */
    justify-content: center;
}
.product-detail-modal .thumbnail-strip img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 0.375rem; /* rounded-md */
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.product-detail-modal .thumbnail-strip img:hover,
.product-detail-modal .thumbnail-strip img.active {
    border-color: #3b82f6; /* blue-500 */
    transform: scale(1.05);
}
.product-detail-modal .product-details-content {
    flex: 2;
    min-width: 300px;
}
.product-detail-modal .product-details-content h2 {
    color: #1a202c; /* gray-800 */
    font-size: 1.875rem; /* text-3xl */
    font-weight: 700; /* font-bold */
    margin-top: 0;
    margin-bottom: 0.5rem;
}
.product-detail-modal .modal-product-price {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 800; /* font-extrabold */
    color: #2563eb; /* blue-600 */
    margin-bottom: 1rem;
}
.product-detail-modal .product-details-content p {
    margin-bottom: 0.5rem;
    color: #4a5568; /* gray-700 */
}
.product-detail-modal .product-details-content strong {
    color: #1a202c; /* gray-800 */
}
.product-detail-modal .product-details-content h4 {
    color: #1a202c; /* gray-800 */
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.25rem; /* text-xl */
    font-weight: 700; /* font-bold */
}
.product-detail-modal .product-details-content ul {
    list-style: disc;
    margin-left: 1.25rem; /* pl-5 */
    padding-left: 0;
    color: #4a5568; /* gray-700 */
}
.product-detail-modal .product-details-content ul li {
    margin-bottom: 0.25rem;
}
.product-detail-modal .add-to-cart-button {
    background-color: #2563eb; /* blue-600 */
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1.125rem; /* text-lg */
    border-radius: 9999px; /* rounded-full */
    cursor: pointer;
    margin-top: 1.5rem;
    transition: background-color 0.3s ease;
}
.product-detail-modal .add-to-cart-button:hover {
    background-color: #1d4ed8; /* blue-700 */
}

/* Cart Modal Specific Styles */
#cart-modal .modal-content {
    max-width: 600px;
}

#cart-items-container .cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

#cart-items-container .cart-item:last-child {
    border-bottom: none;
}

#cart-items-container .cart-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-right: 1rem;
}

#cart-items-container .cart-item-details {
    flex-grow: 1;
}

#cart-items-container .cart-item-details h4 {
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

#cart-items-container .cart-item-details p {
    font-size: 0.875rem;
    color: #4a5568;
    margin: 0;
}

#cart-items-container .cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#cart-items-container .cart-item-actions .item-price {
    font-weight: 700;
    color: #2563eb;
}

#cart-items-container .cart-item-actions button {
    background: none;
    border: none;
    color: #ef4444; /* red-500 */
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s ease;
}

#cart-items-container .cart-item-actions button:hover {
    color: #dc2626; /* red-700 */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .main-nav li {
        margin: 5px 0;
    }

    .product-detail-modal .modal-body {
        flex-direction: column;
    }

    .product-detail-modal .product-image-gallery, .product-detail-modal .product-details-content {
        min-width: unset; /* Reset min-width for smaller screens */
        width: 100%;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .close-button {
        top: 0.75rem;
        right: 1rem;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .product-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }

    .product-detail-modal .product-details-content h2 {
        font-size: 1.8rem;
    }

    .product-detail-modal .modal-product-price {
        font-size: 1.5rem;
    }
}

.card-link {
    position: relative;
    display: inline-block;
}

.card-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: none;
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.card-link:hover .card-tooltip {
    display: block;
}

.card-tooltip img {
    width: 200px;
}

.product-card .product-image-container {
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    position: relative;
    background-color: #f8fafc; /* gray-50 */
}

.product-card .product-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 1px solid #e2e8f0;
}

.product-info .price {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 800; /* font-extrabold */
    color: #2563eb; /* blue-600 */
    margin-bottom: 0.75rem;
}

.product-info .availability {
    font-size: 0.875rem; /* text-sm */
    color: #16a34a; /* green-600 */
    font-weight: 500;
    margin-bottom: auto; /* Pushes actions to the bottom */
}

.product-actions button {
    flex: 1;
    padding: 0.6rem 1rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.product-actions .add-to-cart-btn:hover {
    background-color: #1d4ed8; /* blue-700 */
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.product-actions .view-more-btn {
    background-color: #ffffff;
    color: #4a5568; /* gray-700 */
    border-color: #e2e8f0; /* gray-200 */
}

.product-actions .view-more-btn:hover {
    background-color: #f8fafc; /* gray-50 */
    border-color: #cbd5e0; /* gray-300 */
}

/* Product Detail Modal Specific Styles */
@media (min-width: 768px) {
    .product-detail-modal .modal-body {
        flex-direction: row;
    }
}
.product-detail-modal .product-details-content {
    flex: 1.5;
}
.product-detail-modal .product-details-content p {
    line-height: 1.6;
}
.product-detail-modal .product-details-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.125rem; /* text-lg */
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}
.product-detail-modal .product-details-content ul li {
    margin-bottom: 0.5rem;
}
.product-detail-modal .modal-add-to-cart-button {
    background-color: #16a34a; /* green-600 */
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem; /* text-lg */
    border-radius: 9999px; /* rounded-full */
    cursor: pointer;
    margin-top: 1.5rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}
.product-detail-modal .modal-add-to-cart-button:hover {
    background-color: #15803d; /* green-700 */
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.4);
}

/* Cart Modal Specific Styles */
#cart-items-container .cart-item {
    gap: 1rem;
    padding: 1rem 0;
}

#cart-items-container .cart-item img {
    width: 80px;
    height: 80px;
}

#cart-items-container .cart-item-details h4 {
    margin: 0 0 0.25rem 0;
}

#cart-items-container .cart-item-actions {
    flex-direction: column;
    align-items: flex-end;
}

#cart-items-container .cart-item-actions button.remove-item-btn {
    font-size: 0.8rem;
}

#cart-items-container .cart-item-actions button.remove-item-btn:hover {
    color: #dc2626; /* red-700 */
}

/* --- NEW: Messenger Widget Redesign --- */
#messenger-widget-container.minimized #messenger-widget {
    display: none;
}
#messenger-widget-container.minimized #messenger-open-btn {
    display: flex;
}
#messenger-open-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    background-color: #2563eb; /* blue-600 */
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 9999px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-in-out;
}
#messenger-open-btn:hover {
    transform: scale(1.1);
}
#messenger-open-btn .fa-comments {
    font-size: 24px;
}

/* --- Feed Tabs --- */
.feed-tab-button {
    @apply py-4 px-1 text-center border-b-2 font-medium text-lg text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:border-gray-500;
}
.feed-tab-button.active {
    @apply text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400;
}

/* --- NEW STYLES FOR UI/UX REVAMP --- */
/* --- Toast Notification Styles --- */
.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4-6px -2px rgba(0, 0, 0, 0.05);
    color: white;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.toast.show {
    opacity: 1;
    transform: translateX(0);
}
.toast-info { background-color: #3b82f6; } /* blue-500 */
.toast-success { background-color: #22c55e; } /* green-500 */
.toast-error { background-color: #ef4444; } /* red-500 */
.toast-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

/* --- Notification Bell Styles --- */
#notification-dropdown {
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}
#notification-dropdown.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}
.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb; /* gray-200 */
    transition: background-color 0.2s;
}
.dark .notification-item {
    border-bottom-color: #374151; /* gray-700 */
}
.notification-item:hover {
    background-color: #f9fafb; /* gray-50 */
}
.dark .notification-item:hover {
    background-color: #1f2937; /* gray-800 */
}
.notification-item.is-read {
    opacity: 0.7;
}
.notification-item img {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    margin-right: 0.75rem;
    object-fit: cover;
}
.notification-item-content {
    flex: 1;
}
.notification-item-content p {
    font-size: 0.875rem;
    line-height: 1.4;
    color: #374151; /* gray-700 */
}
.dark .notification-item-content p {
    color: #d1d5db; /* gray-300 */
}
.notification-item-content .timestamp {
    font-size: 0.75rem;
    color: #6b7280; /* gray-500 */
    margin-top: 0.25rem;
}

/* --- Follow Button State --- */
.follow-btn.following {
    background-color: #e5e7eb; /* gray-200 */
    color: #374151; /* gray-700 */
    border: 1px solid #d1d5db; /* gray-300 */
}
.dark .follow-btn.following {
    background-color: #374151; /* gray-700 */
    color: #d1d5db; /* gray-300 */
    border-color: #4b5563; /* gray-600 */
}

/* === Modal and Toast Styling === */
/* Modal Overlay */
.modal-overlay {
    backdrop-filter: blur(4px);
}

/* Modal Content */
.dark .modal-content {
    background-color: #1f2937; /* gray-800 */
}

/* Modal Close Button */
.modal-close-btn {
    top: 10px;
    right: 15px;
    font-size: 1.8rem;
    color: #9ca3af; /* gray-400 */
}
.dark .modal-close-btn {
    color: #6b7280; /* gray-500 */
}
.modal-close-btn:hover {
    color: #111827; /* gray-900 */
}
.dark .modal-close-btn:hover {
    color: #f9fafb; /* gray-50 */
}

/* General Input Styling */
.input-style {
    appearance: none;
    border-radius: 0.5rem;
    position: relative;
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border-width: 1px;
    border-color: #d1d5db; /* gray-300 */
    background-color: #f9fafb; /* gray-50 */
    placeholder-color: #6b7280; /* gray-500 */
    color: #111827; /* gray-900 */
}
.dark .input-style {
    border-color: #4b5563; /* gray-600 */
    background-color: #374151; /* gray-700 */
    placeholder-color: #9ca3af; /* gray-400 */
    color: #ffffff;
}
.input-style:focus {
    outline: none;
    --tw-ring-color: #3b82f6; /* blue-500 */
    box-shadow: 0 0 0 2px var(--tw-ring-color);
    border-color: #3b82f6; /* blue-500 */
}

/* Primary and Secondary Buttons */
.btn-primary {
    font-size: 0.875rem;
    font-weight: 500;
}
.btn-secondary {
    font-size: 0.875rem;
    font-weight: 500;
}
.dark .btn-secondary {
    border-color: #4b5563; /* gray-600 */
    background-color: #1f2937; /* gray-800 */
    color: #d1d5db; /* gray-300 */
}
.btn-secondary:hover {
    background-color: #f9fafb; /* gray-50 */
}
.dark .btn-secondary:hover {
    background-color: #374151; /* gray-700 */
}
.btn-secondary-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* Separator */
.separator {
    margin: 1.25rem 0;
    font-size: 0.75rem;
}
.separator::before, .separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: #d1d5db; /* gray-300 */
}
.dark .separator::before, .dark .separator::after {
    background-color: #4b5563; /* gray-600 */
}
.separator::before { left: 0; }
.separator::after { right: 0; }

/* Dropdown Item */
.dropdown-item {
    font-size: 0.875rem;
}
.dark .dropdown-item {
    color: #d1d5db; /* gray-300 */
}
.dropdown-item:hover {
    background-color: #f3f4f6; /* gray-100 */
}
.dark .dropdown-item:hover {
    background-color: #374151; /* gray-700 */
}

/* Toast Container */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Toast Styling */
.toast {
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.toast-icon {
    margin-right: 10px;
    font-size: 1.2em;
}
.toast-success { background-color: #10b981; }

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}

/* Styles for modal in dark mode */
body.dark-mode .modal-content {
    background-color: #333;
    color: #f0f0f0; /* Text color for dark mode */
    border-color: #555;
}

body.dark-mode .close-button:hover,
body.dark-mode .close-button:focus {
    color: #fff;
}

.modal-switch {
    text-align: center;
    margin-top: 15px;
}

.modal-switch a {
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
}
.trade-tab-button.active {
  --tw-text-opacity: 1;
  color: rgb(59 130 246 / var(--tw-text-opacity));
  border-bottom-color: rgb(59 130 246 / var(--tw-text-opacity));
  border-bottom-width: 2px;
  font-weight: 600;
}

.dark .trade-tab-button.active {
    --tw-text-opacity: 1;
    color: rgb(96 165 250 / var(--tw-text-opacity));
    border-bottom-color: rgb(96 165 250 / var(--tw-text-opacity));
}

/* --- Chat Window Layout --- */
#chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#active-chat-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden; /* Prevent this container from growing */
}

#messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Replaces space-y-2 */
}

#message-form {
    flex-shrink: 0; /* Prevent the form from shrinking */
}

/* --- Messenger Widget Layout --- */
#widget-chat-view {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden; /* Prevent this container from growing */
}

#widget-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Replaces space-y-3 */
}

#widget-message-form {
    flex-shrink: 0;
}
/* Force centering for the dynamically created terms modal */
#terms-modal {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Mobile Messaging Styles --- */
@media (max-width: 640px) {
    #mobile-back-btn {
        position: absolute;
        top: 50%;
        left: 12px;
        transform: translateY(-50%);
        z-index: 10;
        display: block !important;
    }
    
    .mobile-chat-active #mobile-back-btn {
        display: block !important;
    }
    
    #chat-header {
        padding-left: 80px !important;
    }
    
    .mobile-chat-active #chat-header {
        padding-left: 80px !important;
    }
    
    /* Hide chat elements by default on mobile */
    #active-chat-container {
        display: none !important;
    }
    
    /* Only show chat when mobile-chat-active */
    .mobile-chat-active #active-chat-container {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 1000 !important;
        background: #f9fafb !important;
    }
    
    .mobile-chat-active #messages-container {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 12px !important;
        padding-bottom: 140px !important; /* Full space for message timestamps */
        margin-bottom: 0 !important;
    }
    
    /* Message form fixed at bottom with proper spacing */
    .mobile-chat-active #message-form {
        display: flex !important;
        gap: 8px !important;
        padding: 12px !important;
        background: white !important;
        border-top: 1px solid #e5e7eb !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1001 !important;
        margin: 0 !important;
        height: 68px !important; /* Fixed height */
        box-sizing: border-box !important;
    }
    
    .mobile-chat-active #message-input {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 10px 15px !important;
        border: 1px solid #d1d5db !important;
        border-radius: 25px !important;
        background: #f9fafb !important;
        font-size: 16px !important;
        height: 44px !important;
        box-sizing: border-box !important;
    }
    
    .mobile-chat-active #message-form button {
        flex-shrink: 0 !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        background: #2563eb !important;
        color: white !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Dark mode support for mobile */
    .dark .mobile-chat-active #active-chat-container {
        background: #111827 !important;
    }
    
    .dark .mobile-chat-active #message-form {
        background: #1f2937 !important;
        border-top-color: #374151 !important;
    }
    
    .dark .mobile-chat-active #message-input {
        background: #374151 !important;
        border-color: #4b5563 !important;
        color: white !important;
    }
}

/* --- Mobile Conversations List --- */
@media (max-width: 640px) {
    /* Hide conversations list when chat is active */
    .mobile-chat-active #conversations-list {
        display: none !important;
    }
    
    /* Hide chat window by default, only show when chat is active */
    #chat-window {
        display: flex !important;
    }
    
    .mobile-chat-active #chat-window {
        width: 100% !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 999 !important;
    }
    
    /* Ensure placeholder is hidden when chat is active */
    .mobile-chat-active #chat-placeholder {
        display: none !important;
    }
}
/* Additional mobile-specific fixes */
@media (max-width: 768px) {
  /* Ensure conversations list doesn't take too much space on mobile */
  #conversations-list {
    width: 100% !important;
    max-width: 320px;
  }
  
  /* Make chat window take remaining space properly */
  #chat-window {
    min-width: 0;
    flex: 1;
  }
  
  /* Fix message form to stay within bounds */
  #message-form {
    gap: 8px;
    padding: 0;
  }
  
  /* Ensure message input doesn't overflow */
  #message-input {
    min-width: 0;
    flex: 1;
  }
  
  /* Fix send button size and positioning */
  #message-form button {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
  }
  
  /* Improve header search on mobile */
  .relative input {
    width: 100% !important;
    max-width: 250px;
  }
  
  /* Better spacing for mobile */
  .p-4 {
    padding: 12px;
  }
  
  /* Ensure proper text wrapping */
  .space-y-2 > * {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

@media (max-width: 640px) {
  /* Hide conversations list on very small screens when chat is active */
  .mobile-chat-active #conversations-list {
    display: none;
  }
  
  /* Full width chat on small screens */
  .mobile-chat-active #chat-window {
    width: 100%;
  }
  
  /* Smaller padding on very small screens */
  .p-4 {
    padding: 8px;
  }
  
  /* Adjust header height for mobile */
  header {
    height: auto;
    min-height: 64px;
    padding: 12px 16px;
  }
  
  /* Stack header elements on very small screens */
  header .flex {
    flex-wrap: wrap;
    gap: 8px;
  }
}
/* --- New Message Button (Floating Action Button) --- */
.new-message-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #2563eb; /* blue-600 */
    color: white;
    font-size: 24px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease-in-out, background-color 0.2s;
}

.new-message-btn:hover {
    background-color: #1d4ed8; /* blue-700 */
    transform: scale(1.1);
}

/* Card hover effect */
.card-container .card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-container .card:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.search-result-item:hover {
    transform: scale(1.05);
    z-index: 10;
}
/* Settings Page Specific Styles */
.settings-page-container {
    max-width: 1200px;
}
.settings-nav-btn {
    @apply transition-colors duration-200;
}
.settings-section {
    @apply transition-opacity duration-200;
}
.settings-section.hidden {
    @apply absolute opacity-0 pointer-events-none;
}
/* Styles from File 1 for PWA/App section */
.install-card {
    @apply bg-gradient-to-r from-blue-500 to-purple-600 text-white p-6 rounded-lg shadow-lg;
}
.install-btn {
    @apply bg-white text-blue-600 px-6 py-3 rounded-lg font-semibold hover:bg-gray-100 transition-colors;
}
.share-btn {
    @apply bg-blue-700 text-white px-6 py-3 rounded-lg font-semibold hover:bg-blue-800 transition-colors;
}
.feature-grid {
    @apply grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mt-6;
}
.feature-card {
    @apply bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700;
}
.platform-grid {
    @apply grid grid-cols-1 md:grid-cols-2 gap-6 mt-6;
}
.platform-card {
    @apply bg-white dark:bg-gray-800 p-6 rounded-lg border border-gray-200 dark:border-gray-700;
}


/* ===================================================================
   MTG DRAFT APPLICATION STYLES
   ================================================================== */

/* --- Draft Lobby Styles --- */
.draft-card-preview {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.draft-card-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.draft-lobby-bg {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #4a5568 100%);
    min-height: 100vh;
}

.draft-status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.draft-status-waiting {
    background-color: #fbbf24;
    color: #92400e;
}

.draft-status-drafting {
    background-color: #34d399;
    color: #065f46;
}

.draft-status-completed {
    background-color: #60a5fa;
    color: #1e40af;
}

/* --- Draft Room Styles --- */
.draft-pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.draft-card {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.draft-card:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.draft-card img {
    width: 100%;
    height: auto;
    display: block;
}

.draft-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: flex-end;
    padding: 0.5rem;
}

.draft-card:hover .draft-card-overlay {
    opacity: 1;
}

.draft-card-info {
    color: white;
    font-size: 0.75rem;
}

.draft-card-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.draft-card-rarity {
    opacity: 0.8;
}

.draft-timer-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(#3b82f6 0deg, #e5e7eb 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.draft-timer-text {
    font-weight: bold;
    font-size: 1.125rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* --- Deck Builder Styles --- */
.deck-builder-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    height: calc(100vh - 140px);
}

.deck-zone {
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.pool-zone {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #6b7280;
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.2);
}

.card-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    overflow-y: auto;
    padding: 0.5rem;
    max-height: 400px;
}

.deck-card {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.deck-card:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.deck-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.card-count-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.mana-curve-container {
    display: flex;
    align-items: end;
    gap: 0.25rem;
    height: 60px;
    margin-top: 1rem;
}

.mana-curve-bar {
    flex: 1;
    background: linear-gradient(to top, #3b82f6, #60a5fa);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    min-height: 2px;
}

.mana-curve-label {
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* --- Game Room Styles --- */
.game-board {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    position: relative;
    overflow: hidden;
}

.game-board::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23334155" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.battlefield-zone {
    position: relative;
    z-index: 1;
    min-height: 150px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.battlefield-zone:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.2);
}

.game-card {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.game-card:hover {
    transform: scale(1.1) translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.game-card.tapped {
    transform: rotate(90deg);
    opacity: 0.7;
}

.game-card.tapped:hover {
    transform: rotate(90deg) scale(1.1) translateY(-8px);
}

.game-card.selected {
    border: 3px solid #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.game-card.attacking {
    border: 3px solid #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    animation: attack-glow 1s ease-in-out infinite alternate;
}

@keyframes attack-glow {
    from { box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }
    to { box-shadow: 0 0 25px rgba(239, 68, 68, 0.8); }
}

.game-card.blocking {
    border: 3px solid #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    animation: block-glow 1s ease-in-out infinite alternate;
}

@keyframes block-glow {
    from { box-shadow: 0 0 15px rgba(16, 185, 129, 0.5); }
    to { box-shadow: 0 0 25px rgba(16, 185, 129, 0.8); }
}

.hand-zone {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.25rem;
    padding: 1rem;
    min-height: 140px;
    position: relative;
    z-index: 1;
}

.hand-card {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hand-card:hover {
    transform: translateY(-20px) scale(1.05);
    z-index: 15;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.life-counter {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
}

.life-counter.low-life {
    color: #ef4444;
    animation: low-life-pulse 2s ease-in-out infinite;
}

@keyframes low-life-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.mana-symbol {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mana-symbol:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.6);
}

.mana-white { background: linear-gradient(135deg, #fffbd5, #f7fafc); color: #000; }
.mana-blue { background: linear-gradient(135deg, #0e68ab, #3182ce); }
.mana-black { background: linear-gradient(135deg, #150b00, #2d3748); }
.mana-red { background: linear-gradient(135deg, #d3202a, #e53e3e); }
.mana-green { background: linear-gradient(135deg, #00733e, #38a169); }
.mana-colorless { background: linear-gradient(135deg, #9ca3af, #d1d5db); color: #000; }

.phase-indicator {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.phase-active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-color: #60a5fa;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    animation: phase-pulse 2s ease-in-out infinite;
}

@keyframes phase-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6); }
}

.phase-inactive {
    background: #374151;
    color: #9ca3af;
    border-color: #4b5563;
}

.game-log {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.log-entry {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding-left: 0.5rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.priority-indicator {
    animation: priority-pulse 1.5s ease-in-out infinite;
}

@keyframes priority-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* --- Stack Zone Styles --- */
.stack-zone {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(31, 41, 55, 0.95));
    border: 3px solid #fbbf24;
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 200;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    min-width: 300px;
    max-width: 500px;
}

.stack-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.stack-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* --- Targeting Lines --- */
.targeting-line {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #fbbf24, #ef4444);
    z-index: 150;
    pointer-events: none;
    border-radius: 2px;
    animation: targeting-flow 2s linear infinite;
}

@keyframes targeting-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .deck-builder-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .draft-pack-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .hand-zone {
        gap: 0.125rem;
    }
    
    .hand-card {
        max-width: 80px;
    }
    
    .game-card {
        max-width: 80px;
    }
    
    .mana-symbol {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

/* --- Accessibility Improvements --- */
@media (prefers-reduced-motion: reduce) {
    .draft-card,
    .deck-card,
    .game-card,
    .hand-card,
    .mana-symbol,
    .phase-indicator {
        transition: none;
        animation: none;
    }
    
    .game-card.attacking,
    .game-card.blocking,
    .phase-active,
    .priority-indicator {
        animation: none;
    }
}

/* --- Focus States for Keyboard Navigation --- */
.draft-card:focus,
.deck-card:focus,
.game-card:focus,
.hand-card:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* --- Loading States --- */
.loading-shimmer {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- Notification Styles --- */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification-success { background: linear-gradient(135deg, #10b981, #059669); }
.notification-error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.notification-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.notification-info { background: linear-gradient(135deg, #3b82f6, #2563eb); }

/* --- Card Rarity Indicators --- */
.rarity-common { border-left: 4px solid #6b7280; }
.rarity-uncommon { border-left: 4px solid #c0c0c0; }
.rarity-rare { border-left: 4px solid #ffd700; }
.rarity-mythic { border-left: 4px solid #ff6b35; }

/* --- Smooth Scrollbars --- */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
.card-actions button {
    transition: all 0.2s ease-in-out;
}

.card-actions button:hover {
    transform: scale(1.1);
    color: #3b82f6; /* Tailwind's blue-500 */
}

/* Ensure top mover cards have a minimum height */
.top-mover-card {
    min-height: 80px; 
}

/* --- Deck Builder Form Fixes --- */
/* === DECK BUILDER FORM STYLING === */

/* Main form container */
.deck-builder-form {
    max-width: 100%;
    width: 100%;
    padding: 0;
}

/* Header section with title and import button */
.deck-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.dark .deck-builder-header {
    border-bottom-color: #374151;
}

/* Form sections with better visual separation */
.deck-builder-form .form-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dark .deck-builder-form .form-section {
    background: #1f2937;
    border-color: #374151;
}

/* Basic info section (Deck Name + Game) */
.deck-basic-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Format selection styling */
.deck-format-section {
    margin-bottom: 1.5rem;
}

/* Form groups */
.deck-builder-form .form-group {
    width: 100%;
    margin-bottom: 0;
}

.deck-builder-form .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.dark .deck-builder-form .form-group label {
    color: #d1d5db;
}

/* Enhanced input styling */
.deck-builder-form input,
.deck-builder-form select,
.deck-builder-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.875rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    background: white;
}

.dark .deck-builder-form input,
.dark .deck-builder-form select,
.dark .deck-builder-form textarea {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.deck-builder-form input:focus,
.deck-builder-form select:focus,
.deck-builder-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Game dropdown specific styling */
.deck-builder-form select {
    min-width: 200px;
    cursor: pointer;
}

/* Deck list textarea specific styling */
#decklist-input {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    resize: vertical;
    min-height: 160px;
}

/* Privacy checkbox styling */
.deck-privacy-section {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.dark .deck-privacy-section {
    background: #1e3a8a;
    border-color: #3b82f6;
}

/* Enhanced button layout */
.deck-builder-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e5e7eb;
}

.dark .deck-builder-buttons {
    border-top-color: #374151;
}

.deck-builder-buttons button {
    flex: 1;
    min-width: 200px;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.deck-builder-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Primary button (Build & Price) */
#build-deck-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

#build-deck-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

/* Secondary button (Save Deck) */
#save-deck-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

#save-deck-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Tertiary button (Write Primer) */
#write-primer-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

#write-primer-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

/* Import button styling */
#import-deck-btn {
    background: #6b7280;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#import-deck-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Responsive design */
@media (max-width: 768px) {
    .deck-basic-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .deck-builder-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .deck-builder-buttons {
        flex-direction: column;
    }
    
    .deck-builder-buttons button {
        min-width: auto;
        width: 100%;
    }
    
    .deck-builder-form .form-section {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .deck-builder-header h1 {
        font-size: 1.5rem;
    }
    
    #import-deck-btn {
        width: 100%;
        justify-content: center;
    }
}
.foil-effect {
    position: relative;
    overflow: hidden;
}

.foil-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 60%
    );
    animation: foil-sheen 3s infinite;
}

@keyframes foil-sheen {
    0% {
        transform: translateX(-100%) skewX(-30deg);
    }
    100% {
        transform: translateX(200%) skewX(-30deg);
    }
}
/* =================================================== */
/* NEW, MORE SPECIFIC MULTI-SELECT STYLES              */
/* =================================================== */

/* Use the specific ID to increase priority */
#set-checkboxes label,
#rarity-checkboxes label {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
}

#set-checkboxes label:hover,
#rarity-checkboxes label:hover {
    background-color: #f3f4f6;
}

.dark #set-checkboxes label:hover,
.dark #rarity-checkboxes label:hover {
    background-color: #374151;
}

/* Target the checkbox directly to make it visible */
#set-checkboxes input[type="checkbox"],
#rarity-checkboxes input[type="checkbox"] {
    -webkit-appearance: auto !important; /* Use !important to force override */
    -moz-appearance: auto !important;
    appearance: auto !important;
    height: 1rem !important;
    width: 1rem !important;
    margin-right: 0.75rem !important;
}
