/* This is the stylesheet for the HCT Student Portal. */

:root {
    --primary-yellow: #FFC107;
    --primary-black: #1a1a1a;
    --secondary-yellow: #FFD54F;
    --accent-yellow: #FFECB3;
    --dark-blue: #0d1a2e;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #6c757d;
    --text-color: #212529;
    --card-border: #dee2e6;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: #fff;
    color: var(--text-color);
    margin: 0;
}

.container {
    max-width: 1140px; /* Added max-width for consistency */
    margin: 0 auto;
    padding: 0; /* Ensure no padding on .container itself */
}

/* Header */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid var(--card-border);
    padding: 0; /* Removed padding */
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px; /* Fixed height for header */
}

.logo img {
    height: 52px; /* Adjusted height */
    width: auto;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    margin-left: auto; /* Pushes nav to the left */
    margin-right: 1rem; /* Space between nav and actions */
}

.main-nav a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: var(--text-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.my-account-btn {
    background-color: var(--primary-yellow);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.my-account-btn:hover {
    background-color: #ffca2c;
}

/* Main Content */
main {
    padding: 0 2rem; /* Apply horizontal padding directly to main */
}

/* Main Content */
main {
    padding: 1.5rem 2rem 2rem 2rem; /* Top, Right, Bottom, Left */
}

main .container {
    padding-top: 0;
    padding-bottom: 0;
}

/* Hero Section */
.hero {
    text-align: left;
    padding: 1.5rem 0;
}

.hct-tag {
    background-color: var(--dark-blue);
    color: var(--primary-yellow);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    display: inline-flex; /* Use inline-flex for alignment */
    align-items: center;
    gap: 0.25rem;
    font-weight: 700;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin: 0;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin: 0.5rem 0 2rem;
}

.hero .actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.search-bar {
    flex-grow: 1;
    max-width: 400px; /* Limit search bar width */
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--card-border);
    border-radius: 50px;
    font-size: 1rem;
    padding-left: 3rem; /* Space for icon */
}

.search-bar::before {
    content: '\1F50D'; /* Unicode search icon */
    font-family: 'Segoe UI Symbol', 'Apple Color Emoji', sans-serif; /* Fallback for icon */
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap; /* Prevent button text from wrapping */
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background-color: var(--primary-yellow);
    color: var(--text-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background-color: #ffca2c;
}

.btn-secondary {
    background-color: #fff;
    color: var(--text-color);
    border-color: var(--card-border);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-secondary:hover {
    background-color: var(--light-gray);
}

/* Categories Section */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Adjusted min-width for 3:2 ratio */
    gap: 1rem;
    margin-top: 1.5rem; /* Reduced margin-top */
}

.category-card {
    background-color: var(--dark-gray); /* Fallback background color */
    background-size: cover;
    background-position: center;
    color: white;
    height: 120px; /* Height for 3:2 ratio with 180px width */
    border-radius: 12px;
    display: flex;
    align-items: center; /* Vertically center text */
    justify-content: center; /* Horizontally center text */
    padding: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative; /* For text positioning and overlay */
    overflow: hidden;
}

.category-card a {
    text-decoration: none;
    color: white; /* Ensure text is white */
    position: relative; /* Ensure text is above overlay */
    z-index: 2;
    text-align: center; /* Ensure text is centered within its own space */
    display: block; /* Make the link fill the card for easier clicking */
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card h3 {
    font-size: 1.1em;
    margin: 0;
    color: #fff; /* Ensure text is white for contrast */
    position: relative; /* Ensure text is above overlay */
    z-index: 2;
    text-align: center; /* Ensure text is centered within its own space */
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); /* Solid black overlay with 50% opacity */
    z-index: 1;
}

.category-card:hover {
    transform: scale(1.05);
}

.main-content-wrapper {
    background-color: #fff;
    /* padding: 2rem; Removed to increase content space */
    border-radius: 12px;
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); Removed unwanted shadow */
}

/* Main Layout Grid */
.stats-and-filters {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem; /* Reduced margin-top */
}

.stats-section h3,
.filters-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-blue);
    border-bottom: 1px solid var(--medium-gray);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Stats Section */
.stats {
    display: flex;
    flex-direction: row; /* Arrange stat boxes side-by-side */
    gap: 1rem;
}

.stat-box {
    display: flex;
    flex-grow: 1; /* Make stat boxes fill available width */
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    border: 2px solid var(--primary-black);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-box.ideas {
    background-color: var(--primary-yellow);
    color: var(--text-color);
}

.stat-box.trending {
    background-color: var(--dark-blue);
    color: white;
}

.stat-number {
    font-size: 2rem;
    margin-right: 0.5rem;
}

/* Filters Section */
.filters-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters {
    display: flex;
    flex-direction: row; /* Arrange filter links side-by-side */
    justify-content: flex-end; /* Right-justify the filter links */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 0.75rem; /* Space between filter links */
}

.filter-tag {
  background-color: var(--primary-yellow);
  color: var(--primary-black);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 500;
  margin-right: 1rem;
}

.filter-link {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-link:hover {
    background-color: var(--medium-gray);
    color: var(--text-color);
}

.filter-link.active {
    background-color: var(--dark-blue);
    color: white;
}

/* Idea Grid */
#idea-tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Responsive grid */
    gap: 2rem; /* Space between tiles */
    margin-top: 1.5rem; /* Add some space above the grid */
}

.idea-card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.idea-card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.idea-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.idea-card-image {
    height: 180px;
    background-color: var(--medium-gray); /* Placeholder */
    background-image: url('https://images.unsplash.com/photo-1518770660439-4636190af475?w=400');
    background-size: cover;
    background-position: center;
}

.idea-card-tags {
    padding: 1rem 1rem 0.5rem;
}

.tag {
    background-color: var(--medium-gray);
    color: var(--dark-gray);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-right: 0.5rem;
}

.idea-card h3 {
    font-size: 1.2rem;
    margin: 0.5rem 1rem;
}

.idea-card p {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin: 0.5rem 1rem 1rem;
    line-height: 1.5;
}

.idea-card .heart-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    fill: rgba(255,255,255,0.5);
    stroke: white;
    stroke-width: 2;
    cursor: pointer;
}

/* Footer */
.main-footer {
    background-color: var(--dark-blue);
    color: #fff;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr; /* Adjusted column distribution */
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-logo {
    height: 30px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1); /* To make it white */
}

.footer-col h4 {
    color: var(--primary-yellow);
    margin-top: 0;
    margin-bottom: 1rem;
}

.footer-col p {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    text-decoration: none;
    color: var(--dark-gray);
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #343a40;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--dark-gray);
}

.footer-bottom a {
    color: var(--primary-yellow);
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        height: auto;
        gap: 1rem;
    }

    .main-nav {
        margin: 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .hero .actions {
        flex-direction: column;
    }

    .search-bar {
        max-width: 100%;
    }

    .stats-and-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo {
        margin-left: auto;
        margin-right: auto;
    }
}