/* A little custom CSS to use the Inter font */
body {
    font-family: 'Inter', sans-serif;
}

/* Styles for the new search input */
.search-input {
    width: 100%;
    padding: 0.75rem 1rem; /* py-3 px-4 */
    font-size: 1rem; /* text-base */
    border: 1px solid #CBD5E0; /* border-gray-300 */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.search-input:focus {
    outline: none;
    border-color: #4299E1; /* focus:border-blue-500 */
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5); /* focus:ring */
}

/* Styles for the new list header */
.list-header {
    display: flex;
    padding: 0.75rem 1.5rem; /* p-3 px-6 */
    font-size: 0.875rem; /* text-sm */
    color: #4A5568; /* text-gray-700 */
    font-weight: 600; /* font-semibold */
    text-transform: uppercase;
    letter-spacing: 0.05em; /* tracking-wider */
}

/* Styles for each row in the crypto list */
.crypto-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem; /* p-4 px-6 */
    border-bottom: 1px solid #E2E8F0; /* border-gray-200 */
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.crypto-row:last-child {
    border-bottom: none;
}

.crypto-row:hover {
    background-color: #2D3748; /* Dark Gray */
    color: #FFFFFF; /* White */
}

/* --- ADDED RULES --- */
/* These rules ensure specific colors are preserved or adjusted on hover for readability. */

/* Makes the main coin name text white on hover */
.crypto-row:hover .text-gray-900 {
    color: #FFFFFF;
}

/* Preserves the green/red colors for the 24h change */
.crypto-row:hover .text-green-500 {
    color: #48BB78;
}
.crypto-row:hover .text-red-500 {
    color: #F56565;
}

/* Makes the coin symbol and market cap a lighter gray for better contrast */
.crypto-row:hover .text-gray-500,
.crypto-row:hover .text-gray-600 {
    color: #A0AEC0;
}
/* --- END OF ADDED RULES --- */


/* Styles for the new sortable headers */
.sortable-header {
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent; /* Removes flash on mobile tap */
}

.sortable-header:hover {
    color: #1A202C; /* text-gray-900 */
}

/* Justify right-aligned headers */
.list-header .text-right {
    justify-content: flex-end;
}

/* Styles for the sorting arrow icons */
.sort-arrow {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5rem; /* ml-2 */
    opacity: 0.4;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.sortable-header.active .sort-arrow {
    opacity: 1;
}

/* SVG icons for up/down arrows (URL-encoded) */
.sortable-header.asc .sort-arrow {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232D3748'%3E%3Cpath d='M7 14l5-5 5 5H7z'/%3E%3C/svg%3E");
}

.sortable-header.desc .sort-arrow {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232D3748'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
}
