/* General Styles - Inspired by zerow-project.eu */
body {
    font-family: 'Arial', sans-serif; /* Placeholder, adjust to match ZeroW */
    margin: 0;
    padding: 0;
    background-color: #f4f4f4; /* Light grey background */
    color: #2A5A5B; /* Dark teal/greenish text */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Header */
header {
    background-color: #ffffff; /* White background for header */
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 3px solid #2A5A5B; /* Dark teal/greenish accent */
}

.header-content {
    display: flex;
    justify-content: space-between; /* Re-add for overall spacing */
    align-items: center; /* Vertically aligns items */
    flex-wrap: wrap; /* Allow wrapping for responsiveness */
    max-width: 1200px;
    margin: 0 auto;
    /* Align logos with card borders by using symmetrical padding */
    padding: 0 calc(0.5rem - 5px); /* Sets top/bottom to 0, left/right to calc(0.5rem - 5px) */
}

.header-left { /* New style for the left group */
    display: flex;
    align-items: center;
}

.logo {
    display: block; /* Explicit display type */
    width: 50px; /* Explicitly set width */
    height: 50px; 
    margin-right: 1rem; /* Add margin to space logo from title */
    object-fit: contain; /* Ensure proper scaling */
    cursor: pointer; /* Make logo itself clickable for modal */
}

header h1 {
    color: #2A5A5B; /* Dark teal/greenish color for title */
    margin: 0; /* Remove default margins, spacing handled by .header-left and .logo */
    font-size: 1.8rem;
    cursor: pointer; /* Make title clickable for modal */
}

.header-button {
    background-color: #007bff; /* Blue similar to ZeroW buttons */
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.header-button:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

/* Style for the ZeroW button to act like an icon button */
.zerow-favicon-button {
    background-color: transparent;
    border: none;
    padding: 0; /* Remove padding if it's just an icon */
    cursor: pointer;
    /* Ensure the button itself doesn't add extra space if its content is sized */
    line-height: 0; /* Helps align icon if there were text */
    display: inline-flex; /* Aligns well with other header items */
    align-items: center;
    justify-content: center;
}

.zerow-favicon-button .button-favicon {
    height: 50px; /* Match .logo height */
    width: 50px;  /* Match .logo width */
    display: block; 
    border-radius: 5px; 
    object-fit: contain; /* Ensure proper scaling */
}

.zerow-favicon-button:hover .button-favicon {
    opacity: 0.8; /* Slight visual feedback on hover */
}

/* Main Content */
main {
    flex-grow: 1;
    padding: 2rem; /* Ensure this padding matches header-content padding */
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

#category-view h2, #activity-view-title {
    color: #2A5A5B; /* Dark teal/greenish */
    text-align: left; /* Align to the left */
    margin-bottom: 2rem;
    /* The padding on 'main' and 'header-content' should align these titles with the cards' container */
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: stretch; /* This makes all grid items the same height */
}

/* Category Card */
.category-card {
    background-color: #E0E0E0; /* Light grey/off-white background */
    border: 1px solid #ccc; /* Adjusted border for new background */
    border-left: 5px solid #B85C47; /* Red/brown accent */
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    /* Removed height: 100% which was causing overlap */
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.category-card h3 {
    margin-top: 0;
    display: flex; /* Use flexbox to align icon and text */
    align-items: center; /* Vertically align icon and text */
    font-size: 1.25rem; /* Match info-card h4 title size */
}

.category-icon {
    margin-right: 8px; /* Space between icon and category title */
    font-size: 1.5em; /* Adjust icon size as needed */
    /* Optional: if you want the icon to inherit the card's border color */
    /* color: var(--category-color); */ 
}

.category-card .activity-count {
    font-size: 0.9rem;
    color: #4A6A6B; /* Slightly lighter teal/greenish for less emphasis */
    margin-bottom: 0.5rem;
}

.category-card .category-description {
    font-size: 1rem;
    color: #2A5A5B; /* Dark teal/greenish */
    line-height: 1.6;
    margin-bottom: 1rem;
}

.category-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.category-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.category-card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.category-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.category-stats span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(184, 92, 71, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #2A5A5B;
    font-weight: 500;
}

.category-stats span:nth-child(even) {
    background-color: rgba(42, 90, 91, 0.1);
}

.stat-number {
    font-weight: bold;
    color: #B85C47;
    margin-right: 0.5rem;
}

/* Activity View */
#back-to-categories-button {
    background-color: #6c757d; /* Grey button */
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 2rem;
    display: block; /* Make it a block to center if needed or for spacing */
    transition: background-color 0.3s ease;
}

#back-to-categories-button:hover {
    background-color: #5a6268;
}

/* Activity Card */
.activity-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    padding: 1rem; /* Assuming a general padding for the card */
}

.activity-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-left: 0; /* Align with parent card's padding */
    margin-left: 0;  /* Reset any specific margin */
}

.activity-card-header img {
    width: 20px; /* Adjust size as needed */
    height: 20px; /* Adjust size as needed */
    margin-left: 0;   /* Align icon with the start of the header */
    margin-right: 0.5rem; /* Space between icon and title */
    object-fit: contain;
}

.activity-card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.activity-card .goals {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    padding-left: 0; /* Align with parent card's padding */
    margin-left: 0;  /* Reset any specific margin */
}

.activity-tags {
    margin-bottom: 0.75rem;
    padding-left: 0; /* Align with parent card's padding */
    margin-left: 0;  /* Reset any specific margin */
}

.activity-tags .tag {
    display: inline-block;
    background-color: #e9ecef; /* Light grey for tags */
    color: #495057;
    padding: 0.3rem 0.7rem;
    border-radius: 15px; /* Pill-shaped tags */
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.activity-card .source {
    font-size: 0.85rem; /* Match tag font size */
    color: #2A5A5B; /* Match activity name color */
    text-decoration: none;
    word-break: break-all; /* Allow long URLs/sources to break */
}

.activity-card .source:hover {
    text-decoration: underline;
    color: #1A4A4B; /* Darker shade on hover */
}

.activity-card .source-link a {
    color: #2A5A5B; /* Match activity name color */
    text-decoration: none;
    font-weight: normal; /* Set font-weight to normal */
    word-break: break-all; /* Allow long URLs to break */
    font-size: 0.85rem; /* Match tag font size */
}

.activity-card .source-link a:hover {
    text-decoration: underline;
    color: #1A4A4B; /* Darker shade on hover */
}

/* Footer */
footer {
    background-color: #2A5A5B; /* Dark teal/greenish background from image */
    color: #AFC1C2; /* Light greenish/greyish font color from image */
    text-align: center;
    padding: 1.5rem 2rem;
    border-top: 3px solid #1A4A4B; /* Slightly darker teal for border */
}

footer p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

footer a {
    color: #D0E0D1; /* Lighter shade for links, ensuring contrast */
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
    color: #ffffff; /* White on hover for better visibility */
}

/* Info Cards Section */
#info-cards-section {
    background-color: #ffffff;
    padding: 1rem 0; /* Vertical padding for the section */
    width: 100%;
    box-sizing: border-box;
}

.info-cards-container {
    display: grid; /* Changed from flex */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Added */
    max-width: 1200px;
    margin: 0 auto; /* Center on desktop and mobile */
    gap: 1.5rem; /* Consistent gap between slides */
    padding: 0 2rem; /* Default horizontal padding, matches main */
    box-sizing: border-box; /* Include padding in width calculation */
}

.info-card {
    background-color: #fff; /* Card background */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Card shadow */
    padding: 1.5rem; /* Consistent card padding, same as category-card */
    box-sizing: border-box;
    /* width: 300px; Removed, grid handles width */
    text-align: left; /* Changed from center to left */
    /* flex-shrink: 0; Removed, not for grid items here */
    display: flex; /* Added for centering content */
    flex-direction: column; /* Added to stack content vertically */
    justify-content: center; /* Added for vertical centering */
    align-items: flex-start; /* Changed from center to flex-start for left alignment of content blocks */
}

/* Specific style for info-card containing only an image */
.info-card img {
    width: 100%; /* Make image take full width of card */
    height: 100%; /* Make image take full height of card */
    object-fit: cover; /* Cover the area, may crop */
    border-radius: inherit; /* Inherit border-radius from parent card if needed */
}

.info-card:has(img) {
    padding: 0; /* Remove padding if card only contains an image */
}

.info-card h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #2A5A5B; /* Match category card title color */
    font-size: 1.25rem; /* Match category card h3 title size */
}

.info-card p {
    margin-bottom: 0;
    font-size: 1rem; /* Match category card description font size */
    color: #2A5A5B; /* Match category card description color */
}

/* Responsive hiding of info-cards */
/* Hide 3rd card when viewport width is 1011px or less (typically not enough space for 3 cards) */
@media (max-width: 1011px) {
    .info-cards-container .info-card:nth-child(3) {
        display: none;
    }
}

/* Hide all info cards when screen is too small to show two cards side by side */
/* Calculation: 2 cards (300px each) + gap (1.5rem) + padding (2rem each side) = ~650px */
@media (max-width: 687px) {
    #info-cards-section {
        display: none;
    }
}

/* Mobile: Responsive layout for info cards */
@media (max-width: 768px) {
    /* No specific mobile overrides needed here for #info-cards-section or .info-cards-container */
    /* The base grid styles will apply, allowing cards to wrap */
}

/* Adjust padding for very small screens, consistent with main content */
@media (max-width: 480px) {
    .info-cards-container {
        padding: 0 1rem; /* Matches main's padding on very small screens */
    }
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); 
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* Responsive margin */
    padding: 25px;
    border: 1px solid #888;
    width: 80%; /* Responsive width */
    max-width: 600px; /* Max width for larger screens */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: #2A5A5B; /* Modal text color */
    position: relative; /* Needed for absolute positioning of close button and potentially logo */
}

.modal-logo { /* New style for modal logo */
    position: absolute;
    top: 25px; /* Match padding */
    left: 25px; /* Match padding */
    width: 40px; /* Adjust size as needed */
    height: 40px; /* Adjust size as needed */
    object-fit: contain;
}

.modal-content h2 {
    color: #2A5A5B;
    margin-top: 0;
    padding-left: 55px; /* Add padding to make space for the logo: logo width + desired margin */
    margin-bottom: 1rem; /* Ensure space below title */
    line-height: 40px; /* Align vertically with 40px high logo */
}

.modal-content p {
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 1rem; /* Explicitly set font size for paragraph text */
    color: #000000; /* Black font color for content text */
}

.modal-content a {
    color: #2A5A5B; /* Match dialog title color */
    text-decoration: none;
    font-weight: normal; /* Remove bold */
    font-size: 1rem; /* Match paragraph font size */
}

.modal-content a:hover {
    text-decoration: underline;
}

.close-button {
    color: #aaa;
    /* float: right; */ /* Replaced by absolute positioning */
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px; /* Adjusted for better visual alignment */
    right: 20px;
}

/* FAB Styles */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #B85C47; /* Same as category card left border */
    color: white; /* Icon color */
    border: none;
    border-radius: 50%; /* Circular shape */
    width: 56px; /* Standard FAB size */
    height: 56px; /* Standard FAB size */
    font-size: 24px; /* Icon size */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 1050; /* Ensure it's above modals if they are 1000 */
}

.fab:hover {
    background-color: #A04C3B; /* Darker shade on hover */
    transform: scale(1.05);
}

/* Splash Modal Styles */
.splash-modal {
    z-index: 2000; /* Higher than other modals to show on top */
}

.splash-content {
    max-width: 500px;
    margin: 15% auto; /* Centered vertically */
    text-align: center;
    padding: 2rem;
}

.splash-section {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.splash-text {
    font-size: 1.2rem;
    color: #2A5A5B;
    line-height: 1.5;
    margin: 0;
    font-weight: 500;
}

.splash-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    position: relative; /* Enable positioning for child elements */
}

.splash-connecting-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background-color: rgb(145, 188, 161); /* Same color as hexagon container */
    z-index: 1; /* Place behind the icons but above modal background */
    transform: translateY(-50%); /* Center vertically */
}

.splash-icon {
    font-size: 3rem;
    color: #B85C47;
    background-color: #f4f4f4;
    border-radius: 50%;
    padding: 1rem;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2; /* Ensure icons appear above the connecting line */
}

.splash-icon-logo {
    padding: 0.5rem; /* Reduced padding for logo icons */
}

.splash-icon-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0; /* Remove border-radius for the image itself */
}

/* Hexagonal container for ZeroW logo */
.splash-icon-hexagon {
    border-radius: 0; /* Remove circular border-radius */
    background-color: rgb(145, 188, 161); /* Custom green background color */
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    position: relative;
    width: 4.2rem; /* 5% wider than the original 4rem */
    height: 4rem; /* Ensure same height as other icon containers */
}

/* Cubic container for first splash icon */
.splash-icon-cubic {
    border-radius: 8px; /* Rounded corners for cubic appearance */
    background-color: #f4f4f4; /* Same background as default splash icons */
    border: 3px solid rgb(145, 188, 161); /* Green border matching hexagon and connecting line */
    width: 4.2rem; /* 5% larger than default icons (4rem * 1.05) */
    height: 4.2rem; /* 5% larger than default icons (4rem * 1.05) */
}

/* Reduced radius container for third splash icon */
.splash-icon-reduced-radius {
    border-radius: 50%; /* Perfect circular border */
    border: 3px solid rgb(145, 188, 161); /* Green border matching hexagon and connecting line */
    width: 3.2rem; /* Further reduced for better visual alignment */
    height: 3.2rem; /* Further reduced for better visual alignment */
}

.splash-button {
    background-color: #B85C47;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.splash-button:hover {
    background-color: #A04C3B;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start; /* Align items to the start on smaller screens */
    }

    .header-left {
        margin-bottom: 0.5rem; /* Add some space below logo-title group */
    }

    header h1 {
        font-size: 1.5rem; /* Slightly smaller title on small screens */
        margin-left: 0; /* Adjust if logo margin is removed or changed */
    }

    .zerow-favicon-button {
        display: none; /* Hide the ZeroW button when header stacks */
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }
    main {
        padding: 1rem;
    }
    .logo {
        height: 40px;
        width: 40px; /* Ensure width is also adjusted */
    }
    .zerow-favicon-button .button-favicon {
        height: 40px; /* Match logo size on small screens */
        width: 40px;  /* Match logo size on small screens */
    }
    header h1 {
        font-size: 1.3rem;
        margin-top: 0.5rem; /* Ensure space when title is below icons */
    }
    /* .header-button { ... } */ /* Styles for generic .header-button might need review */
    .category-card, .activity-card {
        padding: 1rem;
    }
    .activity-card-header {
        margin-left: -1rem; /* Adjust to match new card padding */
        margin-right: -1rem; /* Adjust to match new card padding */
        margin-top: -1rem; /* Adjust to match new card padding */
        padding: 0.5rem 1rem; /* top/bottom 0.5rem, left/right 1rem to align content */
    }
}

/* Charts View Styles */
.charts-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #2A5A5B;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #1f4344;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.chart-card {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.chart-card h3 {
    margin: 0 0 1rem 0;
    color: #2A5A5B;
    font-size: 1.2rem;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-card {
        padding: 1rem;
    }
    
    .charts-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: #2A5A5B;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    background-color: #1f4344;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.floating-home-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: #2A5A5B;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-home-button:hover {
    background-color: #1f4344;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
