:root {
    --bg-color: #f4f4f5;
    --card-bg-color: #1c1c1e;
    --text-color: #ffffff;
    --primary-text-color: #111827;
    --secondary-text-color: #6b7280;
    --accent-color: #374151;
    --border-color: #e5e7eb;
    --nav-bg-color: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-family: 'Inter', sans-serif;
}

/* Basic Reset & Body Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    line-height: 1.6;
}

.top-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #374151, #e5e7eb);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.detail-header {
    margin: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-text-color);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-text-color);
}

.portfolio-header {
    text-align: center;
    margin: 2rem 0 4rem 0;
}

.portfolio-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.portfolio-header p {
    font-size: 1.1rem;
    color: var(--secondary-text-color);
    margin-bottom: 1.5rem;
}

/* Add this to your existing CSS */
.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 1.5rem;
    background-color: var(--card-bg-color);
    color: var(--text-color);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px var(--shadow-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.github-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px var(--shadow-color);
}

.github-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background-color: #fff;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px var(--shadow-color);
}

.share-btn:hover {
    background-color: #f9fafb;
}

/* --- Navigation Menu Styles --- */
.nav-menu-wrapper {
    position: relative; /* This is the anchor for the absolute positioned menu */
}

.nav-menu {
    position: absolute;
    bottom: calc(100% + 10px); /* Position above the button with 10px margin */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--nav-bg-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow-color);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: max-content; /* Make the menu as wide as its longest item */
    z-index: 999;
    
    /* Hidden by default with a transition */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px) scale(0.95);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;
}

.nav-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

.nav-menu a {
    color: var(--primary-text-color);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    text-align: center;
}

.nav-menu a:hover {
    background-color: var(--bg-color);
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    min-height: 100px; /* Prevents container collapse before content loads */
}

.no-results-message {
    grid-column: 1 / -1; /* Span all columns */
    text-align: center;
    color: var(--secondary-text-color);
    padding: 3rem;
    font-size: 1.1rem;
}

/* Project Card */
.project-card {
    background-color: var(--card-bg-color);
    color: var(--text-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #a1a1aa; /* Lighter grey for this text */
}

.card-category {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.kebab-menu {
    cursor: pointer;
}

.card-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.project-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.card-footer {
    text-align: right;
}

.project-link {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.project-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Floating Navigation Bar */
.floating-nav {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--nav-bg-color);
    border-radius: 9999px;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 1000;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--secondary-text-color);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
}

.nav-btn:hover {
    background-color: var(--bg-color);
    color: var(--primary-text-color);
}

/* Tooltip for Ask button */
.tooltip {
    position: relative;
}

.tooltip:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background-color: var(--primary-text-color);
    color: var(--text-color);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 1001;
}

.tooltip:hover:before {
    opacity: 1;
    visibility: visible;
}

/* Search Modal */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search-modal-overlay.visible .search-modal-content {
    transform: translateY(0);
}

.search-modal-content h2 {
    margin-bottom: 0.5rem;
}

.search-modal-content p {
    color: var(--secondary-text-color);
    margin-bottom: 1.5rem;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    line-height: 1;
    font-weight: bold;
    color: var(--secondary-text-color);
    background: none;
    border: none;
    cursor: pointer;
}

#filter-results-count {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    min-height: 1em;
}

/* Footer */
.main-footer { text-align: center; padding: 2rem; color: var(--secondary-text-color); font-size: 0.9rem; border-top: 1px solid var(--border-color); }

/* Responsiveness */
@media (max-width: 576px) {
    .container {
        padding: 1rem;
        /* Add space at bottom so content isn't hidden by nav bar */
        padding-bottom: 8rem; 
    }
    .portfolio-header h1 {
        font-size: 2rem;
    }
}
