/* assets/css/token_detail_page.css */

/* Ensure body takes full height for sticky footer if needed, and theming */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Ensure base text color and background are from style.css */
}

/* Outer wrapper controlling max-width and centering for the whole page content */
/* Using .container as per style.css examples, combined with site-container-wrapper */
.container.site-container-wrapper {
    flex-grow: 1;
    max-width: 1200px; /* Max width for the entire content */
    margin: 20px auto; /* Center the container and add vertical margin */
    padding: 0 15px; /* Consistent horizontal padding for all content inside */
    width: 100%; /* Ensure it takes full width up to max-width */
    box-sizing: border-box;
}


/* Project Title and Intro Section - Re-purposed token-banner */
/* Used for the logo, name, symbol, and one-liner at the top of the main content */
.token-banner {
    background-color: var(--card-bg-color, #ffffff); /* Use CSS variables for theming */
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow, 0 4px 12px rgba(0,0,0,0.05));
    margin-bottom: 30px; /* Space below the title banner */
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}
body.dark-mode .token-banner {
    --card-bg-color: #2d3748; /* Tailwind gray-800 */
    --card-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.token-banner-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color-soft, #e2e8f0);
}
body.dark-mode .token-banner-logo img {
    --border-color-soft: #4a5568;
}

.token-banner-info {
    flex-grow: 1; /* Allow info area to take available space */
    min-width: 0; /* Allow content inside to shrink/wrap */
}

.token-banner-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color-strong, #2d3748);
    display: flex; /* Use flex to align name and symbol badge */
    align-items: center;
    flex-wrap: wrap; /* Allow symbol badge to wrap if name is very long */
}
body.dark-mode .token-banner-info h1 {
    --text-color-strong: #f7fafc;
}

.token-banner-info h1 .token-symbol-badge {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 4px 8px;
    background-color: var(--badge-bg-color, #e2e8f0);
    color: var(--badge-text-color, #4a5568);
    border-radius: 6px;
    margin-left: 15px; /* Space between name and badge */
    text-transform: uppercase;
    flex-shrink: 0; /* Prevent badge from shrinking */
}
body.dark-mode .token-banner-info h1 .token-symbol-badge {
    --badge-bg-color: #4a5568;
    --badge-text-color: #cbd5e0;
}

.token-banner-info .token-name-original {
    font-size: 1rem;
    color: var(--text-color-light, #718096);
    margin-bottom: 10px; /* Remove bottom margin below one-liner */
}
body.dark-mode .token-banner-info .token-name-original {
     --text-color-light: #a0aec0;
}


/* Main Content Area: Grid for Description + Stats (Left) and Data Sources (Right) */
.token-main-content {
    display: grid;
    /* Default to a single column for mobile/smaller screens */
    grid-template-columns: 1fr;
    gap: 20px; /* Space between stacked sections on smaller screens */
    margin-bottom: 30px; /* Space below this main grid area */
}

/* Responsive adjustment for desktop layout */
@media (min-width: 992px) { /* Breakpoint for two-column layout */
    .token-main-content {
        /* Left column (Description + Stats) takes 2 parts, Right column (Data Sources) takes 1 part */
        grid-template-columns: 2fr 1fr;
        gap: 30px; /* Wider gap between columns on desktop */
    }
}

/* Left Column Wrapper (Stacks Description and Stats) */
.token-left-column {
     display: flex;
     flex-direction: column; /* Stack children vertically */
     gap: 20px; /* Space between stacked sections inside the left column */
}


/* Description Section (Now inside left column, stacked above Stats) */
.token-description-section {
    background-color: var(--card-bg-color, #ffffff);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow, 0 4px 12px rgba(0,0,0,0.05));
    /* No margin-bottom needed here, gap in token-left-column handles spacing */
}
body.dark-mode .token-description-section {
    --card-bg-color: #2d3748;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.token-description-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px; /* Space below heading */
    color: var(--text-color-medium, #4a5568);
    /* Add border bottom to all main section headings */
    border-bottom: 1px solid var(--border-color-soft, #e2e8f0);
    padding-bottom: 10px; /* Space below heading text with border */
}
body.dark-mode .token-description-section h2 {
    --text-color-medium: #cbd5e0;
    --border-color-soft: #4a5568;
}

/* Description Section (Content part) */
.token-description-section .description-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-color-default, #495057);
}
body.dark-mode .token-description-section .description-content {
    --text-color-default: #cbd5e0;
}


/* Stats Section (Now inside left column, stacked below Description) */
.token-stats-section {
    background-color: var(--card-bg-color, #ffffff);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow, 0 4px 12px rgba(0,0,0,0.05));
    /* No margin-bottom needed, gap in token-left-column handles spacing */
}
body.dark-mode .token-stats-section {
    --card-bg-color: #2d3748;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.token-stats-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px; /* Space below heading */
    color: var(--text-color-medium, #4a5568);
    /* Add border bottom to all main section headings */
    border-bottom: 1px solid var(--border-color-soft, #e2e8f0);
    padding-bottom: 10px; /* Space below heading text with border */
}
body.dark-mode .token-stats-section h2 {
    --text-color-medium: #cbd5e0;
    --border-color-soft: #4a5568;
}

/* Stats Grid inside the Stats Section - Beautification */
.token-stats-section .stats-grid {
    display: grid;
    /* Default: 1 column on small screens */
    grid-template-columns: 1fr;
    gap: 15px; /* Slightly smaller gap within stats grid */
}
@media (min-width: 576px) { /* Small tablets/large phones */
    .token-stats-section .stats-grid {
         grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* 2+ columns when space allows */
         gap: 20px;
    }
}
@media (min-width: 992px) { /* Desktop - within the 2/3 left column */
    .token-stats-section .stats-grid {
         grid-template-columns: repeat(2, 1fr); /* Explicitly 2 columns on desktop */
         gap: 20px;
    }
}
@media (min-width: 1200px) { /* Larger desktop - could potentially fit 3 in 2/3 column */
     .token-stats-section .stats-grid {
         /* grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); */ /* Or keep 2 columns */
         grid-template-columns: repeat(2, 1fr); /* Sticking to 2 for consistency */
     }
}


/* Stat Item - Beautification */
.stat-item {
    padding: 15px;
    background-color: var(--stat-item-bg, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--border-color-soft, #e9ecef);
    display: flex; /* Use flexbox for label and value */
    flex-direction: column; /* Stack label and value */
    gap: 5px; /* Space between label and value */
    /* Optional: Add subtle hover effect */
    transition: border-color 0.2s ease;
}
body.dark-mode .stat-item {
    --stat-item-bg: #1a202c; /* Slightly darker than card bg */
    --border-color-soft: #374151; /* gray-700 */
}
.stat-item:hover {
    border-color: var(--hover-border-color, #ced4da); /* Subtle border change on hover */
}
body.dark-mode .stat-item:hover {
     --hover-border-color: #718096;
}


.stat-item .label {
    font-size: 0.85rem;
    color: var(--text-color-light, #718096);
    font-weight: 500; /* Make label slightly bolder */
    /* margin-bottom: 5px; Removed margin-bottom, gap handles space */
    display: block;
}
body.dark-mode .stat-item .label { color: var(--text-color-light-dark, #a0aec0); }


.stat-item .value {
    font-size: 13px; /* Adjusted size */
    font-weight: 600;
    color: var(--text-color-strong, #2d3748);
    word-break: break-all; /* For long URLs/numbers */
    line-height: 1.4; /* Improve readability for multi-line values */
}
body.dark-mode .stat-item .value { color: var(--text-color-strong-dark, #f7fafc); }

/* Style for website link specifically */
.stat-item .value.website-link a { /* Targeted website link */
    color: inherit; /* Inherit color from parent value */
    text-decoration: underline;
    word-break: break-all; /* Ensure long URLs break */
    font-size: 13px;
}
.stat-item .value.website-link a:hover {
     text-decoration: none;
}

/* Style for Tags list */
.stat-item .value.tags-list { /* Style the container of tags */
     display: flex;
     flex-wrap: wrap; /* Allow tags to wrap */
     gap: 5px; /* Space between tag items */
     font-size: 1rem; /* Ensure font size is not 0 */
     font-size: 13px;
}
.stat-item .value.tags-list span.tag { /* Assuming tags are span.tag */
     display: inline-block; /* Make tags behave like blocks for spacing */
     background-color: var(--badge-bg-color, #e9ecef); /* Lighter background */
     color: var(--badge-text-color, #495057); /* Darker text */
     padding: 3px 8px;
     border-radius: 4px;
     margin-right: 5px; /* Space between tags */
     margin-bottom: 5px; /* Space if they wrap */
     font-size: 0.85rem; /* Smaller font size */
     white-space: nowrap; /* Prevent tags from breaking internally */
     border: 1px solid var(--border-color-soft, #ced4da); /* Add a subtle border */
}
body.dark-mode .stat-item .value.tags-list {
     /* Inherit text color for container */
}
body.dark-mode .stat-item .value.tags-list span.tag {
     background-color: var(--badge-bg-color-dark, #4a5568);
     color: var(--badge-text-color-dark, #cbd5e0);
     border-color: var(--border-color-soft-dark, #666);
}


/* Style for Investors list */
.stat-item .value.investors-list { /* Style the container of investors */
     /* No specific container style needed if just list of spans */
}
.stat-item .value.investors-list span.investor { /* Assuming investors are span.investor */
     display: inline-block;
     margin-right: 5px; /* Space after name */
     margin-bottom: 5px; /* Space if they wrap */
     word-break: break-word; /* Allow long investor names to break */
     font-size: 1rem; /* Same font size as other values */
}
.stat-item .value.investors-list span.investor::after {
     content: ','; /* Add comma after each investor span */
     margin-left: 0; /* Remove space before comma */
     margin-right: 5px; /* Space after comma */
}
.stat-item .value.investors-list span.investor:last-child::after {
     content: ''; /* Remove comma after the last one */
     margin-right: 0;
}
/* Style for investor links if any */
.stat-item .value.investors-list a {
     color: inherit; /* Inherit color */
     text-decoration: underline;
}
.stat-item .value.investors-list a:hover {
     text-decoration: none;
}


/* Social Media Links within Stats Section */
.stat-item .value.social-links {
    display: flex; /* Use flexbox for social icons */
    align-items: center;
    flex-wrap: wrap; /* Allow icons to wrap */
    gap: 12px; /* Increased space between icons slightly */
    /* Removed font-size: 0; */
    font-size: 13px;
}

.social-links a {
    display: inline-flex; /* Treat link as inline-flex */
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit; /* Icons should inherit color or be colored by SVG fill */
    transition: opacity 0.2s ease; /* Simple hover effect */
}
.social-links a:hover {
    opacity: 0.8;
}

.social-links .icon {
    /* SVG Icon styles */
    width: 24px; /* Set icon size */
    height: 24px;
    vertical-align: middle; /* Align icons with text if any */
    /* Use specific fill colors from the SVG path or set a generic fill */
    /* The provided SVGs have inline fill color, which is good. */
    /* Can set a generic fill here as a fallback or if you want to override */
    /* fill: var(--text-color-medium, #4a5568); */
    /* body.dark-mode & { fill: var(--text-color-medium-dark, #cbd5e0); } */
    /* If SVGs have color paths, they might look better as is, or invert in dark mode */
}
/* Ensure SVGs nested within links or divs take correct size if needed */
.social-links a svg,
.social-links div svg {
     width: 24px;
     height: 24px;
     display: block; /* Or inline-block */
}


/* Data Sources Section (Now the right column section) */
.data-sources-section {
    background-color: var(--card-bg-color, #ffffff);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow, 0 4px 12px rgba(0,0,0,0.05));
    /* No margin-bottom needed, gap in token-main-content handles spacing */
}
body.dark-mode .data-sources-section {
    --card-bg-color: #2d3748;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Corrected typo */
    box-shadow: var(--card-shadow, 0 4px 12px rgba(0,0,0,0.15));
}
.data-sources-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color-medium, #4a5568);
    /* Add border bottom to all main section headings */
    border-bottom: 1px solid var(--border-color-soft, #e2e8f0);
    padding-bottom: 10px;
}
body.dark-mode .data-sources-section h2 { color: var(--text-color-medium-dark, #cbd5e0); }


.data-sources-section .data-sources-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color-default, #495057);
    margin-bottom: 15px; /* Space below paragraph before logos */
}
body.dark-mode .data-sources-section .data-sources-content p { color: var(--text-color-default-dark, #cbd5e0); }


/* Exchange Logos Container (Populated by JS) */
#exchange-logos-container {
    display: flex; /* Use flexbox to arrange logos */
    flex-wrap: wrap; /* Allow logos to wrap to the next line */
    gap: 15px; /* Space between logo items */
    align-items: center; /* Vertically align logos */
    /* Optional: Add some padding if logos touch the edges */
    /* padding-top: 10px; */
    /* border-top: 1px solid var(--border-color-soft, #e2e8f0); /* Optional separator */
}
body.dark-mode #exchange-logos-container {
    /* border-top-color: var(--border-color-soft-dark, #4a5568); /* Optional separator color */
}

.exchange-logo-link {
    /* Link style for logos */
    display: inline-block; /* Treat link as a block/flex item */
    /* Optional: Add border or background if desired */
    /* border: 1px solid #eee; padding: 5px; border-radius: 5px; */
}

.exchange-logo {
    /* Styles for the logo images */
    height: 35px; /* Increased height slightly for better visibility */
    width: auto; /* Allow width to adjust to maintain aspect ratio */
     vertical-align: middle;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #fff;
}

/* Optional: Add a slight hover effect */
.exchange-logo-link:hover .exchange-logo {
    /* transform: scale(1.05); /* Removed scale hover for now */
    opacity: 0.9; /* Add a slight opacity change on hover */
}

/* Dark mode adjustment for logos if needed */
/* Depending on the original logo colors and the dark background, you might need inversion */
body.dark-mode .exchange-logo {
    /* filter: invert(1); /* Example: Invert colors for dark mode if logos are dark on light */
    /* If logos are already somewhat light or colorful, no filter might be needed */
}
body.dark-mode .exchange_logo_link:hover .exchange-logo {
    /* filter: invert(0); /* Revert filter on hover example */
    opacity: 1; /* Full opacity on hover */
}


/* New Section: Top Funded Projects */
.top-funded-projects-section {
    background-color: var(--card-bg-color, #ffffff);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow, 0 4px 12px rgba(0,0,0,0.05));
    margin-top: 30px; /* Space above this section */
}
body.dark-mode .top-funded-projects-section {
    --card-bg-color: #2d3748;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.top-funded-projects-section .section-title { /* Re-using section-title class */
    font-size: 1.75rem; /* Larger section titles (from style.css) */
    font-weight: 600;
    margin-bottom: 1.5rem; /* Space below title */
    color: var(--text-color-medium, #4a5568); /* Darker heading color */
    border-bottom: 1px solid var(--border-color-soft, #e2e8f0); /* Add border bottom */
    padding-bottom: 10px; /* Space below heading with border */
}
body.dark-mode .top-funded-projects-section .section-title {
    color: var(--text-color-medium-dark, #cbd5e0);
    border-bottom-color: var(--border-color-soft-dark, #4a5568);
}


/* Grid for Top Funded Projects (3 columns on large screens) */
.top-funded-projects-grid {
    display: grid;
    /* Responsive grid: 3 columns on large, 2 on medium, 1 on small */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Flexible columns */
    gap: 20px; /* Space between grid items */
}

.top-project-item {
    display: flex; /* Use flex for logo and info layout within the item */
    align-items: center; /* Vertically align content */
    gap: 15px; /* Space between logo and info */
    padding: 15px;
    background-color: var(--stat-item-bg, #f8f9fa); /* Use similar background as stats */
    border-radius: 8px;
    border: 1px solid var(--border-color-soft, #e9ecef);
    text-decoration: none; /* Remove underline from link */
    color: inherit; /* Inherit text color */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Add hover effect */
}
body.dark-mode .top-project-item {
    background-color: var(--stat-item-bg-dark, #1a202c);
    border-color: var(--border-color-soft-dark, #374151);
}

.top-project-item:hover {
    transform: translateY(-3px); /* Lift effect */
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.08);
}
body.dark-mode .top-project-item:hover {
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}


.top-project-item-logo img {
    width: 40px; /* Fixed logo size */
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color-soft, #e2e8f0);
}
body.dark-mode .top-project-item-logo img {
     border-color: var(--border-color-soft-dark, #4a5568);
}


.top-project-item-info {
    flex-grow: 1; /* Allow info to take remaining space */
     min-width: 0; /* Allow text inside to shrink/wrap */
}

.top-project-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color-strong, #2d3748);
    margin-bottom: 5px;
    word-break: break-word;
}
body.dark-mode .top-project-item-name { color: var(--text-color-strong-dark, #f7fafc); }


.top-project-item-funding {
    font-size: 0.85rem;
    color: var(--text-color-medium, #4a5568);
    word-break: break-word;
}
body.dark-mode .top-project-item-funding { color: var(--text-color-medium-dark, #cbd5e0); }


/* Loading spinner/placeholder (existing styles - kept for completeness) */
.loading-value {
    display: inline-block;
    min-width: 50px; /* give some space while loading */
    animation: pulse 1.5s infinite ease-in-out;
}
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}


/* Responsive adjustments */
@media (max-width: 991px) { /* Breakpoint for common mobile/tablet adjustments - Below 992px, token-main-content becomes single column */

    /* Token Banner responsive adjustments */
    .token-banner {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px; /* Adjust padding */
    }
    .token-banner-info h1 {
        font-size: 2rem;
        justify-content: center;
        flex-wrap: wrap; /* Allow symbol badge to wrap */
    }
     .token-banner-info h1 .token-symbol-badge { margin-left: 10px; } /* Adjust margin if wrapping */
     .token-banner-logo img { width: 70px; height: 70px; }


    /* Main Content - Stacked sections */
    .token-main-content {
        grid-template-columns: 1fr; /* Ensure it is a single column */
        gap: 20px; /* Space between stacked sections */
    }

    /* Ensure left column stacks its contents (already flex column) */
    .token-left-column {
        gap: 20px; /* Space between description and stats when stacked */
    }


    /* Add border bottom to all main section headings (covered by general rule) */


    /* Stats grid becomes 2 columns on medium screens */
     .token-stats-section .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }


    /* Top Funded Projects grid becomes 2 columns on medium screens */
    .top-funded-projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }


}
@media (max-width: 767px) { /* Smaller mobile breakpoint */
    .container.site-container-wrapper { padding: 0 10px; } /* Reduce horizontal padding */
    .token-banner, .token-description-section, .token-stats-section, .data-sources-section, .top-funded-projects-section {
         padding: 15px; /* Reduce padding inside sections */
         border-radius: 8px; /* Smaller border radius */
    }

     .token-banner-logo img { width: 60px; height: 60px; } /* Smaller logo */
    .token-banner-info h1 { font-size: 1.75rem; } /* Smaller title */
    .token-banner-info h1 .token-symbol-badge { font-size: 0.8rem; } /* Smaller badge */


    /* Stats grid becomes 1 column on small mobile */
     .token-stats-section .stats-grid { grid-template-columns: 1fr; }

    /* Top Funded Projects grid becomes 1 column on small mobile */
    .top-funded-projects-grid {
        grid-template-columns: 1fr;
    }
    /* Optional: Stack item content on smallest screens */
    .top-project-item {
        flex-direction: column; /* Stack logo and info vertically */
        text-align: center;
    }
    .top-project-item-info { min-width: auto; } /* Remove min-width restriction */
    .top-project-item-logo img { margin-bottom: 10px; } /* Add space below logo */
    .top-project-item-name, .top-project-item-funding { text-align: center; } /* Center text */


}

/* Ensure consistent padding *within* each section */
/* This might override some padding from .container, ensure consistency */
.token-banner,
.token-description-section,
.token-stats-section,
.data-sources-section,
.top-funded-projects-section {
    /* Use padding for the internal spacing */
    padding: 25px 30px; /* Default padding */
}
@media (max-width: 991px) {
     .token-description-section,
     .token-stats-section,
     .data-sources-section,
     .top-funded-projects-section {
          padding: 20px; /* Reduce padding slightly when stacked */
     }
}
@media (max-width: 767px) {
    .token-banner,
     .token-description-section,
     .token-stats-section,
     .data-sources-section,
     .top-funded-projects-section {
          padding: 15px; /* Reduce padding further on mobile */
     }
}


/* Adjust padding/margins for elements immediately following headings within sections */
/* This helps control space regardless of which section it is */
.token-description-section .description-content:first-of-type,
.token-stats-section .stats-grid:first-of-type,
.data-sources-section .data-sources-content p:first-of-type, /* Target the first paragraph */
#exchange-logos-container:first-of-type, /* If logos container is the first thing */
.top-funded-projects-section .top-funded-projects-grid:first-of-type {
    margin-top: 0;
    padding-top: 0;
}

/* Ensure space between Data Sources paragraph and logos */
.data-sources-section .data-sources-content p {
    margin-bottom: 15px; /* Standard spacing */
}
/* If the logos container is the first child after the h2 in data sources */
/* This ensures no extra space if the paragraph is removed or empty */
.data-sources-section .data-sources-content #exchange-logos-container:first-child {
     margin-top: 0;
}

