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

:root {
    --primary-color: #0f4c81;
    --secondary-color: #2ea3f2;
    --bg-color: #f4f7f6;
    --text-color: #333;
    --light-text: #fff;
    --border-radius: 15px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --header-bg: #ffffff;
}

/* Facilities Layout */
.facilities-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: flex-start;
}

.map-column {
    flex: 0 0 70%;
}

.facilities-list-column {
    flex: 0 0 calc(30% - 2rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mini-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-left: 4px solid var(--secondary-color);
}

.mini-card h3 {
    font-size: 1.1rem;
    margin: 0;
}

@media (max-width: 992px) {
    .facilities-container {
        flex-direction: column;
    }

    .map-column,
    .facilities-list-column {
        flex: 0 0 100%;
    }
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.home-page {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.8) 100%), url('irudiak/Kirola_05.png') center/cover no-repeat fixed;
}

body.news-page {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.8) 100%), url('irudiak/Kirola_03.jpg') center/cover no-repeat fixed;
}

body.contact-page {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.8) 100%), url('irudiak/Kirola_04.png') center/cover no-repeat fixed;
}

header {
    background-color: var(--header-bg);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 0.6rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.top-bar-contact {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-bar-contact span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-bar-contact i {
    color: var(--secondary-color);
}

.top-bar-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.lang-switcher {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    width: 120px;
    /* Ancho fijo para alinear con el botón */
}

.lang-switcher a {
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    transition: opacity 0.3s;
}

.lang-switcher a:hover {
    opacity: 0.7;
}

.btn-mi-zona {
    display: block;
    width: 120px;
    /* Mismo ancho que el área de idiomas */
    background-color: var(--secondary-color);
    color: white !important;
    padding: 5px 0;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.75rem;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-mi-zona:hover {
    background-color: #1a8ad4;
    transform: translateY(-1px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
}

nav a:hover::after {
    width: 100%;
}

main {
    flex: 1;
    padding: 2rem;
    width: 80%;
    margin: 0 auto;
}

.hero {
    background: linear-gradient(135deg, rgba(15, 76, 129, 0.8) 0%, rgba(46, 163, 242, 0.8) 100%), url('irudiak/Kirola_05.png') center/cover;
    color: var(--light-text);
    padding: 4rem 2rem;
    text-align: center;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

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

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--light-text);
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: transform 0.3s, background-color 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #1a8ad4;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--light-text);
    margin-left: 1rem;
}

.btn-outline:hover {
    background-color: var(--light-text);
    color: var(--primary-color);
}

.btn-admin-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    transition: all 0.3s;
}

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

.section-title {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

footer {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 3rem 2rem 1rem;
    margin-top: auto;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-section p,
.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(46, 163, 242, 0.1);
}

/* Editor */
#editor-container {
    height: 300px;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.ql-toolbar.ql-snow {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    background: #f8f9fa;
}

.ql-container.ql-snow {
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.news-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
    border: 2px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.news-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    display: inline-block;
    background: #f0f0f0;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.news-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* Backoffice Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: white;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.data-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f9fafb;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Admin floating button */
.admin-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: transform 0.3s;
}

.admin-btn:hover {
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    main {
        width: 100%;
        padding: 1rem;
    }
}

/* Ocultar opciones de Abono, Documentación e Instalaciones según petición del usuario */
nav li:has(a[href="abonos.html"]),
nav li:has(a[href="abonamenduak.html"]),
nav li:has(a[href="documentacion.html"]),
nav li:has(a[href="dokumentazioa.html"]),
nav li:has(a[href="instalaciones.html"]),
nav li:has(a[href="instalazioak.html"]),
.footer-section a[href="abonos.html"],
.footer-section a[href="abonamenduak.html"],
.footer-section a[href="documentacion.html"],
.footer-section a[href="dokumentazioa.html"],
.footer-section a[href="instalaciones.html"],
.footer-section a[href="instalazioak.html"] {
    display: none !important;
}

/* News Carousel */
.carousel-active {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 5px 15px;
    border-radius: 30px;
    border: 1px solid #eee;
}

.carousel-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: transform 0.2s;
}

.carousel-btn:hover {
    transform: scale(1.2);
    color: var(--secondary-color);
}

.data-table small {
    display: block;
    margin-top: 4px;
}