/* FONT FACES */
@font-face { font-family: 'Dosis'; src: url('/assets/Dosis-Regular.ttf'); }
@font-face { font-family: 'SpecialElite'; src: url('/assets/SpecialElite-Regular.ttf'); }

/* GLOBAL RESET & BASE STYLES */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: Dosis, sans-serif; color: #111; background-image: url('/assets/papelito.jpg'); background-size: cover; background-attachment: fixed; line-height: 1.6; }
a { color: #111; text-decoration: none; }
h1, h2, h3 { font-family: SpecialElite, sans-serif; line-height: 1.2; }
h1 { font-size: 2.5rem; }
h1 span { color: #999; }
h2 { font-size: 2rem; }
h2 + .term-list { margin-top: 2rem; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; }
input, textarea, button { font-family: Dosis, sans-serif; padding: 1rem; border: 1px solid #ccc; border-radius: 4px; }
button, input[type="submit"] { cursor: pointer; background-color: #222; color: #fff; border: none; transition: background-color 0.2s; }
button:hover, input[type="submit"]:hover { background-color: #000; }

/* MAIN LAYOUT */
.page-container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.content-wrapper { display: flex; flex-direction: column; gap: 3rem; margin-top: 3rem; }
.main-content { flex: 1; }
.sidebar { flex-basis: 320px; flex-shrink: 0; }
.region-description { font-size: 1.1rem; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid #ddd; line-height: 1.5; font-style: italic; color: #333; }

/* HEADER */
header { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 1rem; padding-bottom: 2rem; border-bottom: 2px solid #ddd; }
.header-nav { display: flex; gap: 1rem; align-items: center; }

/* FOOTER */
footer { margin-top: 4rem; padding-top: 2rem; border-top: 2px solid #ddd; text-align: center; font-size: 0.9rem; color: #555; }
footer a { color: #555; }

/* REUSABLE COMPONENTS */
.btn-primary { display: inline-block; background-color: #222; color: #FFF; padding: 0.6rem 1.2rem; border-radius: 2rem; font-size: 1rem; letter-spacing: 0.05rem; text-align: center; line-height: 1.2; }
.btn-primary:hover { background-color: #000; color: #fff; }
.tag { display: inline-block; background-color: #eee; color: #333; padding: 0.4rem 1rem; border-radius: 1rem; font-size: 0.85rem; height: 30px; line-height: 1.3; }
.tag:hover { background-color: #ddd; }

/* HEADER SEARCH */
.header-search-form { position: relative; display: flex; align-items: center; }
.header-search-form input[type="search"] { background-color: #222; color: #FFF; border-radius: 2rem; font-size: 1rem; line-height: 1.2; width: 9rem; border: 1px solid #222; padding: 0.6rem 2.8rem 0.6rem 1.2rem; transition: background-color 0.2s; -webkit-appearance: none; appearance: none; outline: none; }
.header-search-form input[type="search"]::placeholder { color: #aaa; opacity: 1; }
.header-search-form input[type="search"]:focus { background-color: #000; border-color: #000; }
.header-search-form button { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background-color: #444; color: #fff; font-size: 1.2rem; line-height: 1; border: none; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.2s; }
.header-search-form button:hover { background-color: #555; }


/* TERM LIST */
.term-list { display: flex; flex-direction: column; gap: 4rem; }
.term-item { display: flex; flex-direction: column; gap: 1rem; }
.term-item h2 { margin-bottom: 0.5rem; }
.term-item .explanation, .term-item .example { font-size: 1.1rem; }
.term-item .example { font-style: italic; color: #555; border-left: 3px solid #ccc; padding-left: 1rem; }
.term-footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; min-height: 40px; justify-content: space-between; }
.vote-widget { display: flex; align-items: center; gap: 0.5rem; min-height: 30px; font-style: italic; color: #555; }
.vote-btn { width: 30px; height: 30px; cursor: pointer; opacity: 0.6; transition: opacity 0.2s, transform 0.2s; }
.vote-btn:hover { opacity: 1; transform: scale(1.1); }
.vote-results { display: flex; align-items: center; gap: 0.75rem; }
.vote-count { font-size: 0.9rem; font-weight: bold; }
.vote-count.up-count { color: #27ae60; }
.vote-count.down-count { color: #c0392b; }
.vote-bar-wrapper { width: 120px; height: 10px; display: flex; border-radius: 5px; overflow: hidden; background-color: #e0e0e0; }
.vote-bar { height: 100%; transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1); }
.vote-bar.green { background-color: #2ecc71; }
.vote-bar.red { background-color: #e74c3c; }


/* SIDEBAR WIDGETS */
.sidebar-widget { background: rgba(255,255,255,0.5); padding: 1.5rem; border-radius: 8px; margin-bottom: 2rem; }
.sidebar-widget h3 { font-size: 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid #ccc; padding-bottom: 0.5rem; }
.sidebar-widget ul.sidebar-link-list { display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-widget ul.sidebar-link-list.tips li { padding: 0.5rem 0; }
.sidebar-widget ul.sidebar-link-list li a { font-family: Dosis, sans-serif; color: #333; display: block; padding: 0.5rem 0; position: relative; transition: color 0.2s; }
.sidebar-widget ul.sidebar-link-list li a::after { content: '→'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity 0.2s; color: #000; }
.sidebar-widget ul.sidebar-link-list li a:hover { color: #000; }
.sidebar-widget ul.sidebar-link-list li a:hover::after { opacity: 1; }
.sidebar-nav-buttons { display: flex; flex-direction: column; gap: 0.75rem; }
.yt-video-widget iframe { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; border: none; }

/* FORM STYLES */
.form-container { background: rgba(255,255,255,0.5); padding: 2rem; border-radius: 8px; }
.form-container h2 { margin-bottom: 2rem; }
.form-group { margin-bottom: 1.5rem; position: relative; }
.form-group label { display: block; font-weight: bold; margin-bottom: 0.5rem; }
.form-group input, .form-group textarea { display: block; width: 100%; }
.form-group textarea { height: 120px; resize: vertical; }
.g-recaptcha { margin-bottom: 1.5rem; }
#region-suggestions { border: 1px solid #ccc; border-top: none; max-height: 200px; overflow-y: auto; background: #fff; position: absolute; z-index: 100; width: 100%; }
#region-suggestions div { padding: 10px; cursor: pointer; }
#region-suggestions div:hover, #region-suggestions div.selected { background-color: #f0f0f0; }

/* HOMEPAGE MAP STYLES */
html.map-page, body.map-page { height: 100%; width: 100%; overflow: hidden; background: #2c3e50; }
.logo-circle { position: fixed; top: 20px; left: 20px; width: 60px; height: 60px; background: #fff; color: #222; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'SpecialElite', sans-serif; font-size: 2.2rem; cursor: pointer; z-index: 20; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: transform 0.3s ease; line-height: 1; }
.logo-circle:hover { transform: scale(1.1); }
.home-header-nav { position: fixed; top: 20px; right: 20px; z-index: 20; display: flex; gap: 1rem; align-items: center; }
#info-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-image: url('/assets/papelito.jpg'); background-size: cover; z-index: 19; display: flex; align-items: center; justify-content: center; text-align: center; clip-path: circle(0% at 50px 50px); transition: clip-path 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55); overflow-y: auto; padding: 2rem 0; }
#info-overlay.active { clip-path: circle(150% at 50px 50px); }
#info-overlay .info-content { opacity: 0; transition: opacity 0.4s ease 0.4s; max-width: 700px; width: 90vw; padding: 2rem; margin: auto; }
#info-overlay.active .info-content { opacity: 1; }
#info-overlay .info-content h1 { font-size: 2.8rem; }
#info-overlay .info-content h1 span { color: #999; font-size: 0.75em; vertical-align: baseline; }
#info-overlay .info-content p { font-size: 1.1rem; line-height: 1.5; margin-top: 1rem; text-align: left; }
.info-list { text-align: left; margin: 2rem 0; padding-left: 0; list-style-type: none; }
.info-list li { padding-left: 2.5rem; position: relative; margin-bottom: 1rem; font-size: 1.1rem; }
.info-list li::before { content: ''; position: absolute; left: 0; top: 0.45em; transform: translateY(-50%); font-family: 'SpecialElite'; font-size: 1.2rem; }
.info-list li:nth-child(1)::before { content: '🗺️'; }
.info-list li:nth-child(2)::before { content: '✍️'; }
.info-list li:nth-child(3)::before { content: '🗳️'; }
#map-container { position: relative; width: 100%; height: 100%; cursor: grab; user-select: none; }
#map-container.grabbing { cursor: grabbing; }
#map-inner { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.marker { position: absolute; width: 14px; height: 14px; background: #e74c3c; border: 2px solid #fff; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 2px 5px rgba(0,0,0,0.5); z-index: 4; transition: transform .2s ease-out, opacity .2s, top .2s ease-out, left .2s ease-out; cursor: pointer; }
.marker:hover { transform: translate(-50%, -50%) scale(1.4); z-index: 11; }
.info-box {
    position: absolute;
    display: none;
    width: 300px;
    max-width: 90vw;
    background: #34495e;
    border: 1px solid #7f8c8d;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    color: #ecf0f1;
    padding: 20px;
    z-index: 10;
    animation: fadeIn 0.2s ease-out;
    cursor: auto;
}
.info-box.visible {
    display: block;
}
.info-box h3 { margin: 0 0 10px; font-size: 20px; color: #fff; border-bottom: 1px solid #4a627a; padding-bottom: 10px; padding-right: 30px; line-height:1.2; }
.info-box p { font-size: 15px; line-height: 1.5; }
.info-box-stats { margin-top: 15px; padding-top: 15px; border-top: 1px solid #4a627a; font-size: 14px; color: #bdc3c7; font-style: italic; }
.info-box .btn-primary { margin-top: 15px; padding: 0.5rem 1rem; font-size: 0.9rem; }
.info-box .btn-primary.full-width { display: block; width: 100%; text-align: center; }
.close-btn { position: absolute; width: 30px; height: 30px; background: #2c3e50; border: none; border-radius: 50%; color: #ecf0f1; cursor: pointer; transition: background-color 0.2s; z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; padding: 0 0 2px 0; }
.close-btn:hover { background: #e74c3c; }
.info-box .close-btn { top: 15px; right: 15px; }

#zoom-controls { position: absolute; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
#zoom-controls button { width: 50px; height: 50px; font-size: 28px; font-weight: bold; background: rgba(0,0,0,.6); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; display: flex; align-items: center; justify-content: center; line-height: 1; touch-action: manipulation; }

/* RESPONSIVE DESIGN */
@media (max-width: 799px) {
    .marker {
        width: 24px;
        height: 24px;
        border-width: 3px;
    }
    #info-overlay .info-content {
        padding-top: 5rem;
    }
    .info-box {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        top: auto;
        width: auto;
        max-width: calc(100vw - 20px);
        max-height: 75vh;
        border-radius: 15px;
        padding: 20px;
        transform: translateY(calc(100% + 20px));
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: block;
        opacity: 1;
        pointer-events: none;
        overflow-y: auto;
        animation: none;
    }
    .info-box.visible {
        transform: translateY(0);
        pointer-events: auto;
    }
    .info-box .close-btn {
        top: 10px;
        right: 10px;
    }
}
@media (min-width: 800px) {
    html { font-size: 17px; }
    .page-container { padding: 3rem; }
    header { justify-content: space-between; flex-wrap: nowrap; }
    .content-wrapper { flex-direction: row; }
    .sidebar-widget.sticky-buttons { position: sticky; top: 2rem; z-index: 1; }
    h1 { font-size: 2rem; }
    h2 { font-size: 2.3rem; }
    #info-overlay .info-content h1 { font-size: 3rem; }
    .info-box {
        width: 580px;
    }
}
@media (min-width: 1100px) {
    html { font-size: 18px; }
    .page-container { padding: 4rem; }
    #info-overlay .info-content p { font-size: 1.2rem; }
}

/* CLUSTER STYLES */
.marker.cluster {
    background: #f1c40f;
    border: 3px solid #fff;
    width: 22px;
    height: 22px;
    font-size: 11px;
    color: #3a3a3a;
    font-weight: bold;
    font-family: sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform .2s ease-out, opacity .2s;
}
.marker.cluster::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.5);
    animation: pulse 2s infinite ease-out;
}

@keyframes pulse {
    0% {
        transform: translate(-50%,-50%) scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%,-50%) scale(3);
        opacity: 0;
    }
}