* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #D97642;
    --secondary-color: #BF5B2F;
    --accent-color: #F2A35E;
    --light-bg: #FFF5EC;
    --dark-text: #4A2E1C;
    --white: #FFFFFF;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-text);
    line-height: 1.6;
    background-color: var(--light-bg);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.3);
}

.language-selector {
    display: flex;
    gap: 0.25rem;
    margin-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 1rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: var(--white);
    color: var(--primary-color);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: calc(100vh - 400px);
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Centers Container - Cercles */
.centers-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.center-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--secondary-color);
}

.center-circle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.center-circle[data-image="csmib.jpg"]::before {
    background-image: url('csmib.jpg');
}

.center-circle[data-image="esadib.jpg"]::before {
    background-image: url('esadib.jpg');
}

.center-circle[data-image="esdib.jpg"]::before {
    background-image: url('esdib.jpg');
}

.center-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--white);
}

.center-circle:hover::before {
    opacity: 1;
}

.center-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--white);
    z-index: 2;
    position: relative;
    transition: all 0.4s ease;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.center-circle:hover .center-text {
    color: var(--white);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    font-size: 2rem;
}

/* Taula Corporativa */
.corporate-table-container {
    margin: 2rem 0;
    overflow-x: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.corporate-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
    font-size: 1rem;
}

.corporate-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.corporate-table th {
    padding: 1.2rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.corporate-table th:last-child {
    width: 120px;
    text-align: center;
}

.corporate-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.3s ease;
}

/* Files parells amb color de fons diferent */
.corporate-table tbody tr:nth-child(odd) {
    background-color: var(--white);
}

.corporate-table tbody tr:nth-child(even) {
    background-color: #FFF9F5;
}

.corporate-table tbody tr:hover {
    background-color: #FFE8D6;
}

.corporate-table tbody tr:last-child {
    border-bottom: none;
}

.corporate-table td {
    padding: 1.2rem 1.5rem;
    color: var(--dark-text);
    line-height: 1.6;
}

.link-cell {
    text-align: center;
    vertical-align: middle;
    width: 120px;
}

.pdf-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.pdf-link:hover {
    transform: scale(1.15);
    opacity: 0.8;
}

.pdf-icon {
    width: 45px;
    height: 45px;
    display: block;
    object-fit: contain;
}

/* Formulario de contacto */
.contact-form-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-title {
    color: var(--secondary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--dark-text);
    font-size: 1rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background-color: var(--light-bg);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.phone-group {
    position: relative;
}

.phone-input-group {
    display: flex;
    gap: 0.5rem;
}

.phone-prefix {
    flex: 0 0 200px;
}

.phone-number {
    flex: 1;
}

.character-count {
    text-align: right;
    font-size: 0.875rem;
    color: #666;
}

.error-message {
    color: #d32f2f;
    font-size: 0.875rem;
    min-height: 1.25rem;
    display: block;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 118, 66, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Success Message */
.success-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.success-content {
    background-color: var(--white);
    padding: 3rem;
    border-radius: 15px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s ease;
}

.success-icon {
    display: inline-block;
    width: 80px;
    height: 80px;
    background-color: #4caf50;
    color: white;
    border-radius: 50%;
    font-size: 3rem;
    line-height: 80px;
    margin-bottom: 1.5rem;
}

.success-content p {
    color: var(--dark-text);
    line-height: 1.8;
    margin-bottom: 2rem;
    text-align: center;
}

.close-message-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.close-message-btn:hover {
    background-color: var(--secondary-color);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: var(--white);
    padding: 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.footer-info {
    line-height: 1.8;
    margin-bottom: 1rem;
}

.footer-links {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    margin-right: 1.5rem;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }

    nav.mobile-open {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: left;
    }

    .language-selector {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
        padding-left: 0;
        padding-top: 0.5rem;
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 2rem;
        top: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .footer-links a {
        display: block;
        margin-bottom: 0.5rem;
    }

    .centers-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .center-circle {
        width: 180px;
        height: 180px;
    }

    .center-text {
        font-size: 1.5rem;
    }

    /* Taula corporativa responsive */
    .corporate-table-container {
        border-radius: 5px;
        margin: 1rem 0;
    }

    .corporate-table {
        font-size: 0.9rem;
    }

    .corporate-table th,
    .corporate-table td {
        padding: 1rem;
    }

    .corporate-table th {
        font-size: 1rem;
    }

    /* Taula en format de targetes per mòbil */
    .corporate-table thead {
        display: none;
    }

    .corporate-table,
    .corporate-table tbody,
    .corporate-table tr,
    .corporate-table td {
        display: block;
        width: 100%;
    }

    .corporate-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    /* Mantenir colors alternats en mòbil */
    .corporate-table tr:nth-child(odd) {
        background-color: var(--white);
    }

    .corporate-table tr:nth-child(even) {
        background-color: #FFF9F5;
    }

    .corporate-table tr:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        background-color: #FFE8D6;
    }

    .corporate-table td {
        padding: 1rem;
        border-bottom: none;
        position: relative;
        text-align: left;
    }

    .corporate-table td:first-child {
        font-weight: 500;
        padding-bottom: 0.5rem;
    }

    .link-cell {
        text-align: center;
        padding-top: 1rem;
        padding-bottom: 1.5rem;
        width: 100%;
    }

    .pdf-icon {
        width: 35px;
        height: 35px;
    }

    .corporate-table td:first-child::before {
        content: attr(data-ca);
        display: block;
        font-weight: 600;
        color: var(--primary-color);
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
        text-transform: uppercase;
    }

    /* Formulari responsive */
    .contact-form-container {
        padding: 1.5rem;
        margin: 1rem;
    }

    .form-title {
        font-size: 1.5rem;
    }

    .phone-input-group {
        flex-direction: column;
    }

    .phone-prefix {
        flex: 1;
    }

    .success-content {
        padding: 2rem;
        margin: 1rem;
    }

    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
        line-height: 60px;
    }
}

@media (max-width: 480px) {
    .corporate-table td {
        padding: 0.8rem;
    }

    .pdf-icon {
        width: 30px;
        height: 30px;
    }
}
/* Menú desplegable */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .dropdown-arrow {
    margin-left: 0.3rem;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgba(191, 91, 47, 0.95);
    min-width: 200px;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: rgba(74, 46, 28, 0.3);
    padding-left: 1.5rem;
}

.dropdown-item:first-child {
    padding-top: 1rem;
}

.dropdown-item:last-child {
    padding-bottom: 1rem;
    border-radius: 0 0 5px 5px;
}

/* Responsive dropdown */
@media (max-width: 768px) {
    .nav-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transform: none;
        visibility: visible;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        box-shadow: none;
        border-radius: 0;
        background-color: rgba(191, 91, 47, 0.9);
    }

    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown.active .dropdown-menu {
        opacity: 1;
        max-height: 200px;
    }

    .dropdown-item {
        padding-left: 2rem;
    }

    .dropdown-item:hover {
        padding-left: 2.5rem;
    }
}
/* Organigrama - Targetes de lideratge */
.leadership-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.leader-card {
    background: linear-gradient(135deg, var(--white), var(--light-bg));
    padding: 2rem 3rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 280px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid var(--accent-color);
}

.leader-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(217, 118, 66, 0.3);
}

.leader-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.leader-position {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--dark-text);
    margin: 0;
}

/* Organigrama - Centres */
.org-centers-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.org-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.org-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--secondary-color);
    position: relative;
}

.org-circle::after {
    content: '▼';
    position: absolute;
    bottom: 10px;
    font-size: 1rem;
    color: var(--white);
    opacity: 0.7;
}

.org-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.org-circle.active::after {
    transform: rotate(180deg);
}

.org-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* Llista d'equip */
.team-list {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    min-width: 280px;
}

.team-list.active {
    max-height: 500px;
    opacity: 1;
    padding: 1.5rem;
}

.team-member {
    padding: 1rem;
    border-bottom: 1px solid var(--light-bg);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: background-color 0.3s ease;
}

.team-member:last-child {
    border-bottom: none;
}

.team-member:hover {
    background-color: var(--light-bg);
}

.member-name {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1.05rem;
}

.member-role {
    font-style: italic;
    color: var(--dark-text);
    font-size: 0.95rem;
}

/* Responsive organigrama */
@media (max-width: 768px) {
    .leadership-cards {
        flex-direction: column;
        gap: 1.5rem;
    }

    .leader-card {
        min-width: auto;
        width: 100%;
        padding: 1.5rem 2rem;
    }

    .org-centers-container {
        flex-direction: column;
        gap: 2rem;
    }

    .org-center {
        width: 100%;
    }

    .org-circle {
        width: 130px;
        height: 130px;
    }

    .org-text {
        font-size: 1.3rem;
    }

    .team-list {
        min-width: auto;
    }
}
/* Secció d'arxiu/convocatòries anteriors */
.archive-section {
    margin: 3rem 0;
    border-top: 2px solid var(--accent-color);
    padding-top: 2rem;
}

.archive-toggle {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.archive-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 118, 66, 0.4);
}

.archive-toggle:active {
    transform: translateY(0);
}

.archive-title {
    text-align: left;
    flex: 1;
}

.archive-arrow {
    font-size: 1rem;
    transition: transform 0.4s ease;
    margin-left: 1rem;
}

.archive-toggle.active .archive-arrow {
    transform: rotate(180deg);
}

.archive-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
    background-color: var(--light-bg);
    border-radius: 0 0 10px 10px;
}

.archive-content.active {
    max-height: 5000px;
    opacity: 1;
    padding: 2rem;
    margin-top: 1rem;
    border: 2px solid var(--accent-color);
    border-top: none;
}

.archive-content h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.archive-content h3:first-child {
    margin-top: 0;
}

/* Responsive archive */
@media (max-width: 768px) {
    .archive-toggle {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    .archive-content.active {
        padding: 1.5rem 1rem;
    }
}