:root {
    --color-primary: #21808D;
    --color-primary-hover: #1D7480;
    --color-secondary: #32B8C6;
    --color-background: #FCFCF9;
    --color-surface: #FFFFFD;
    --color-text: #13343B;
    --color-text-secondary: #626C71;
    --color-border: rgba(94, 82, 64, 0.2);
    --color-success: #21808D;
    --color-info: #32B8C6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-base: 8px;
    --radius-lg: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #1F2121;
        --color-surface: #262828;
        --color-text: #F5F5F5;
        --color-text-secondary: rgba(167, 169, 169, 0.7);
        --color-border: rgba(119, 124, 124, 0.3);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #21808D 0%, #32B8C6 100%);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: var(--color-surface);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    text-align: center;
}

h1 {
    color: var(--color-primary);
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: var(--color-text-secondary);
    font-size: 1.1em;
}

.info-box {
    background: rgba(50, 184, 198, 0.1);
    border-left: 4px solid var(--color-secondary);
    padding: 20px;
    border-radius: var(--radius-base);
    margin-top: 20px;
}

.info-box h2 {
    color: var(--color-primary);
    font-size: 1.2em;
    margin-bottom: 10px;
}

.info-box p {
    color: var(--color-text-secondary);
    font-size: 0.95em;
    line-height: 1.5;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--color-border);
}

.stat-number {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    color: var(--color-text-secondary);
    font-size: 0.9em;
    margin-top: 5px;
}

.controls {
    background: var(--color-surface);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.filter-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    font-size: 0.95em;
}

select, input {
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-base);
    font-size: 1em;
    transition: all 0.3s ease;
    background: var(--color-surface);
    color: var(--color-text);
}

select:focus, input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(33, 128, 141, 0.1);
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-base);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: rgba(94, 82, 64, 0.05);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, #21808D 0%, #32B8C6 100%);
}

.card-content {
    padding: 20px;
}

.card-category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(33, 128, 141, 0.1);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.4em;
    color: var(--color-text);
    margin-bottom: 8px;
    font-weight: 600;
}

.card-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.95em;
    margin-bottom: 12px;
}

.card-description-container {
    margin-bottom: 15px;
}

.card-description {
    color: var(--color-text-secondary);
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0 0 4px 0;
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}

.card-description.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 3.2em; /* 2 líneas * 1.6 line-height */
}

.card-description.expanded {
    display: block;
    max-height: 1000px;
    -webkit-line-clamp: unset;
}

.ver-mas-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: opacity 0.2s ease;
    display: inline-block;
    text-align: left;
}

.ver-mas-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid var(--color-border);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: var(--color-text-secondary);
}

.info-icon {
    font-size: 1.1em;
}

.social-links {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(33, 128, 141, 0.1);
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.no-results-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.no-results h2 {
    color: var(--color-text);
    margin-bottom: 10px;
}

.no-results p {
    color: var(--color-text-secondary);
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.loading-spinner {
    font-size: 4em;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }

    .filter-group {
        grid-template-columns: 1fr;
    }

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

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}
