:root {
    --primary-gradient-start: #2d5016;
    --primary-gradient-end: #1a2f0a;
    --accent-color: #4CAF50; /* 76, 175, 80 */
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    min-height: 100vh;
    color: white;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    transition: transform 0.3s, background 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
    background: white;
}

.project-card h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.project-card .scientific {
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.project-card p {
    line-height: 1.5;
    margin-bottom: 15px;
}

.project-card .badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.badge {
    background: rgba(76, 175, 80, 0.3);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.resources {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.btn-resource {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-resource:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.card-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: rgba(33, 150, 243, 0.9);
    color: white;
}

.btn-secondary:hover {
    background: rgba(33, 150, 243, 1);
}

footer {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.7;
}

/* Modal QR */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    color: #333;
}

.modal-content h3 {
    margin-bottom: 10px;
    color: var(--primary-gradient-start);
}

.modal-content p {
    margin-bottom: 20px;
    opacity: 0.7;
}

#qr-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

.btn-close {
    background: #e0e0e0;
    color: #333;
}

.btn-close:hover {
    background: #d0d0d0;
}

.btn-download {
    background: var(--accent-color);
    color: white;
}

.btn-download:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
}


/* Category and Search */
.category-buttons {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.category-buttons .btn {
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.category-buttons .btn.btn-secondary[disabled] {
     background: rgba(255,255,255,0.2);
     color: rgba(255,255,255,0.5);
     cursor: not-allowed;
     border-color: rgba(255,255,255,0.3);
}

.search-filter-bar {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
}

.search-filter-bar input,
.search-filter-bar select {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    font-size: 1rem;
}

.search-filter-bar input {
    flex: 1;
}

.search-filter-bar input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-filter-bar select {
    flex: 0 0 150px;
}

#projects-container {
    padding-top: 0;
}

