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

* {
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    margin: 0;
    background: var(--bg-color);
    color: var(--text-main);
    font-family: "Inter", sans-serif;
    line-height: 1.5;
}

header {
    padding: 1rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    position: relative;
}

.site-logo {
    height: 50px;
    width: auto;
    position: absolute;
    left: 0;
}

header h1 {
    font-size: 1.875rem;
    margin: 0;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
}

.search-container {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 600px;
}

.search-container input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    color: var(--text-main);
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--card-bg);
}

#botao-busca {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: white;
    transition: all 0.2s ease;
}

#botao-busca:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

#botao-busca:active {
    transform: translateY(0);
}

.main-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 120px;
    height: fit-content;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 1rem;
}

.sidebar h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

#lista-tarefas {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-item {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-item:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.task-item.active {
    background-color: var(--primary-color);
    color: white;
}

.task-count {
    font-size: 0.75rem;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 1rem;
}

.task-item.active .task-count {
    background: rgba(255, 255, 255, 0.2);
}

main {
    flex: 1;
    padding: 0;
    min-height: auto;
}

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

.card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.card-logo {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    object-fit: cover;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.card-title {
    flex: 1;
}

.card h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.card-type {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #eff6ff;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    display: inline-block;
}

.card-description {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
}

.card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    background: var(--bg-color);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    margin-top: auto;
}

.card-link:hover {
    background: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

.footer {
    background-color: var(--card-bg);
    color: var(--text-secondary);
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    margin-top: auto;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

@media (max-width: 640px) {
    header {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .card-container {
        grid-template-columns: 1fr;
    }
}