@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
    --background: #181818;
    --surface: #202020;
    --surface-light: #2c2c2c;
    --primary: #30B27B;
    --primary-hover: #299969;
    --on-background: #E5E5E5;
    --on-surface: #CCCCCC;
    --border: #333333;
    --container-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--background);
    color: var(--on-background);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    height: 32px;
}

nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--on-surface);
    font-weight: 500;
    font-size: 0.9rem;
}
.nav-link:hover {
    color: var(--on-background);
    text-decoration: none;
}

.header-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 0 2rem;
}

.search-bar, .search-bar-large {
    display: flex;
    align-items: center;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

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

.search-bar input, .search-bar-large input {
    background: none;
    border: none;
    outline: none;
    color: var(--on-background);
    width: 100%;
    margin-left: 0.5rem;
}

.search-bar input::placeholder, .search-bar-large input::placeholder {
    color: var(--on-surface);
}

.ph {
    color: var(--on-surface);
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--surface-light);
    color: var(--on-background);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: #3a3a3a;
}

/* Main Content */
main {
    flex-grow: 1;
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: var(--on-surface);
    margin-bottom: 2rem;
}

.search-bar-large {
    max-width: 700px;
    margin: 0 auto;
    padding: 0.25rem;
    padding-left: 1rem;
}

.search-bar-large input {
    font-size: 1rem;
    padding: 0.75rem 0;
}
.search-bar-large .btn {
    padding: 0.75rem 1.5rem;
}

/* Projects Section */
.projects-section {
    margin-bottom: 3rem;
}

.projects-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.project-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.project-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-banner {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

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

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

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.card-title-container {
    flex-grow: 1;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--on-background);
}

.card-author {
    font-size: 0.9rem;
    color: var(--on-surface);
}

.card-description {
    font-size: 0.9rem;
    color: var(--on-surface);
    margin-top: 0.75rem;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.card-tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    background-color: var(--surface-light);
    color: var(--on-surface);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--on-surface);
}

/* Footer */
footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-column h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.footer-column h5 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--on-surface);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column a, .footer-column p {
    display: block;
    color: var(--on-surface);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}
.footer-column a:hover {
    color: var(--on-background);
    text-decoration: none;
}

/* Chat Widget */
#chat-toggle-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

#chat-toggle-btn:hover {
    background-color: var(--primary-hover);
    transform: scale(1.1);
}

#chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 350px;
    max-width: calc(100vw - 4rem);
    height: 500px;
    max-height: calc(100vh - 4rem);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    z-index: 1000;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: bottom right;
}

#chat-widget.hidden, #chat-toggle-btn.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--surface-light);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

#chat-header button {
    background: none;
    border: none;
    color: var(--on-surface);
    cursor: pointer;
    font-size: 1.2rem;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 90%;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.chat-username {
    font-size: 0.8rem;
    color: var(--on-surface);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.chat-text {
    background-color: var(--surface-light);
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.own-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.own-message .chat-text {
    background-color: var(--primary);
    color: white;
}

.chat-message.own-message .chat-username {
    display: none;
}

.system-message {
    text-align: center;
    font-size: 0.8rem;
    color: var(--on-surface);
    font-style: italic;
}

#chat-form {
    display: flex;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    gap: 0.5rem;
}

#chat-input {
    flex-grow: 1;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--on-background);
    outline: none;
}

#chat-input:focus {
    border-color: var(--primary);
}

#chat-send-btn {
    background-color: var(--primary);
    border: none;
    color: white;
    border-radius: 8px;
    padding: 0 1rem;
    cursor: pointer;
    font-size: 1.2rem;
}
#chat-send-btn:hover {
    background-color: var(--primary-hover);
}

@media (max-width: 768px) {
    .header-center, nav, .header-right .btn-secondary {
        display: none;
    }
}

@media (max-width: 480px) {
    #chat-widget {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
}