/* elCuro

 * Functions: form validation
 * Author: Giselle Kroeger
 * Date: 03.08.2025
 
 * Filename: scripts.js
 */

/****** FONTS ******/
/* Bebas Neue Font */
@font-face {
    font-family: 'Bebas Neue';
    src: url('../fonts/bebas-neue/BebasNeue-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Urbanist Variable Fonts */
@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/Urbanist-VariableFont_wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/Urbanist-Italic-VariableFont_wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* Urbanist Static Fonts (Fallback) */
@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Italic Styles */
@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-ThinItalic.ttf') format('truetype');
    font-weight: 100;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-ExtraLightItalic.ttf') format('truetype');
    font-weight: 200;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-LightItalic.ttf') format('truetype');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-MediumItalic.ttf') format('truetype');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-SemiBoldItalic.ttf') format('truetype');
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-ExtraBoldItalic.ttf') format('truetype');
    font-weight: 800;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Urbanist';
    src: url('../fonts/Urbanist/static/Urbanist-BlackItalic.ttf') format('truetype');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

/* Bebas Neue Font Definitions */
@font-face {
    font-family: 'Bebas Neue';
    src: url('../fonts/bebas-neue/BebasNeue-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/****** GLOBAL STYLES *****/
body {
    font-family: "Urbanist", sans-serif;
    /* background-color: #f4f4f4; */
    line-height: 1.6;
    margin: 0;
}
.headingBackground, .listBackground {
    background-color: black;
    width: 100%;
    margin: 0;
    padding-top: 2rem;
    padding-bottom: 1rem;
}
.headingBackground h1 {
    margin: 0;
    padding: 0;
}
.listBackground {
    color:#e6e6e6;
}
.imageBackground {
  background-image: url('../images/heading-image.jpg'); /* image path */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 400px;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  color: white; /* text colour */
  box-sizing: border-box;
}

.imageBackground p {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: 500;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}
.container {
    /* background-color: #fff; */
    max-width: 800px;
    margin: 0 auto;
    padding: 2px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}


h1 {
    text-align: center;
    color: #ff0000;
    font-size: 5rem;
    line-height: normal;
    font-family: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
    font-weight: 400;
    letter-spacing: 2px;
}

h2 {
    font-family: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
    font-weight: 400;
    letter-spacing: 1px;
}
.headingImage img {
    width: 100%;
    height: auto;
}
.listBackground h2 {
    text-align: center;
    color: #ff0000;
    font-size: 2rem;
    margin-bottom: 20px;
    line-height: normal;
    font-family: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
    font-weight: 400;
    letter-spacing: 1px;
}
.listBackground li {
    margin-bottom: 10px;
}
.statement {
    margin-bottom: 30px;
    font-size: 1.1em;
    color: #e6e6e6;
    text-align: center;
}
.statement p {
    margin-bottom: 15px;
}
.signatoriesBackground {
    background-color: #f4f4f4;
    padding: 2rem 0;
}
.formBackground {
    background-color: #ff0000;
    padding: 3rem;
    margin: 0;
}
.form-container {
    background-color: white;
    max-width: 800px;
    padding: 20px;
    margin-left: auto;
    margin-right: auto;
    border-top: 1px solid #ccc;
}
.form-container h2 {
    text-align: center;
    color: #ff0000;
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-family: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
    font-weight: 400;
    letter-spacing: 1px;
}
.form-group {
    margin-bottom: 15px;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.radio-group {
    display: flex;
    gap: 20px;
}
.error {
    color: red;
    font-size: 0.9em;
    display: none;
}
button {
    display: block;
    margin: 20px auto 3rem auto; /* top: 20px, horizontal: auto, bottom: 0 */
    background-color: #ff0000;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
button:hover {
    background-color: #0056b3;
}
input[type="submit"] {
    display: block;
    margin: 20px auto 3rem auto; /* top: 20px, horizontal: auto, bottom: 0 */
    background-color: #ff0000;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.grecaptcha-badge {
    visibility: hidden; /* Hide reCAPTCHA badge, but provide notice */
}
.recaptcha-notice {
    font-size: 0.8em;
    color: #555;
    margin-top: 10px;
    text-align: center;
}
.createdFor {
    text-align: center;
    margin-top: 20px;
    font-size: 1.1em;
    color: #e6e6e6;
}
footer {
    padding: 1rem;
    margin: 0;
    width: 100%;
    max-width: 100vw; /* Verhindert horizontales Scrollen */
    box-sizing: border-box; /* Padding wird in die Breite eingerechnet */
    background-color: black;
    overflow-x: hidden; /* Verhindert horizontales Scrollen */
}
.footerLinks {
    max-width: 600px;
    width: 100%;
    margin: 1rem auto 2rem auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    box-sizing: border-box; /* Padding wird in die Breite eingerechnet */
    padding: 0 1rem; /* Seitenabstand für kleine Bildschirme */
}

/* Responsive Footer-Links */
@media (max-width: 768px) {
    .footerLinks {
        grid-template-columns: repeat(3, 1fr); /* 3 + 2 Links */
        gap: 0.8rem;
        justify-items: center; /* Zentriert alle Grid-Items */
        padding: 0 0.5rem; /* Weniger Seitenabstand auf Tablet */
    }
    
    /* Speziell für die letzten beiden Links (4. und 5.) */
    .footerLinks a:nth-child(4),
    .footerLinks a:nth-child(5) {
        grid-column: 2; /* Positioniert sie in der mittleren Spalte */
    }
}

@media (max-width: 480px) {
    .footerLinks {
        grid-template-columns: repeat(2, 1fr); /* 2 + 2 + 1 Links */
        gap: 0.6rem;
        padding: 0 0.3rem; /* Minimaler Seitenabstand auf Mobile */
        max-width: 100%; /* Verhindert Überbreite */
    }
}

@media (max-width: 360px) {
    .footerLinks {
        grid-template-columns: 1fr; /* Alle Links untereinander */
        gap: 0.5rem;
    }
}
.footerLinks a {
    color: #e6e6e6;
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
}
.footerLinks a:hover {
    text-decoration: underline;
    color: #ffffff;
}
hr {
    max-width: 200px;
}

/* Call to Action Button Styles */
.cta-container {
    text-align: center;
    margin: 40px 0;
}

.cta-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 18px 36px;
    font-size: 1.2em;
    font-weight: 600;
    font-family: 'Urbanist', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
    position: relative;
    overflow-x: hidden; /* Verhindert horizontales Scrollen */
}

body {
    position: relative;
    overflow-x: hidden; /* Verhindert horizontales Scrollen */
    max-width: 100vw; /* Verhindert Überbreite */
    box-sizing: border-box;
}

/* Signature Overlay Styles */
.signature-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease-out;
    cursor: pointer;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.signature-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.signature-content {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 40px 60px;
    border-radius: 15px;
    text-align: center;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.3s ease-out;
}

.signature-overlay.fade-out .signature-content {
    transform: scale(0.9);
}

.signature-content h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5em;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.2;
}

.close-indicator {
    font-family: 'Urbanist', sans-serif;
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 15px;
    font-weight: 300;
}

/* Responsive Design for Signature Overlay */
@media (max-width: 768px) {
    .signature-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh;
        -webkit-overflow-scrolling: touch;
    }
    
    .signature-content {
        padding: 30px 40px;
        margin: 20px;
        max-width: calc(100vw - 40px);
    }
    
    .signature-content h2 {
        font-size: 2em;
        letter-spacing: 1px;
    }
    
    .close-indicator {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .signature-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh;
    }
    
    .signature-content {
        padding: 25px 30px;
        max-width: calc(100vw - 20px);
        margin: 10px;
    }
    
    .signature-content h2 {
        font-size: 1.6em;
        letter-spacing: 0.5px;
    }
}

/* Success Notification Styles */
.success-notification {
    background: #f8f9fa;
    border: 1px solid #d4edda;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.success-notification h2 {
    color: #ff0000;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2em;
    margin: 0 0 15px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.success-details {
    text-align: center;
}

.success-details p {
    color: #333;
    font-size: 1em;
    line-height: 1.6;
    margin: 10px auto;
    max-width: 500px;
    text-align: center;
    font-family: 'Urbanist', sans-serif;
    font-weight: 400;
}

/* Responsive Design for Success Notification */
@media (max-width: 768px) {
    .success-notification {
        padding: 15px;
        margin: 15px 0;
    }
    
    .success-notification h2 {
        font-size: 1.6em;
    }
    
    .success-details p {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .success-notification {
        padding: 12px;
        margin: 10px 0;
    }
    
    .success-notification h2 {
        font-size: 1.4em;
    }
    
    .success-details p {
        font-size: 0.95em;
    }
}

/* First Signatories Grid Layout */
.first-signatories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.first-signatories p {
    margin: 5px 0;
    padding: 0;
    line-height: 1.3;
}

/* More Signatories Button */
.more-signatories-container {
    text-align: center;
    margin: 30px 0;
}

.more-signatories-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    font-family: 'Urbanist', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.more-signatories-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Modal Styles */
.signatories-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    overflow-y: auto;
}

.signatories-modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    border-radius: 10px;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-family: 'Bebas Neue', sans-serif;
    color: #333;
}

.modal-close {
    background: none !important;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: color 0.3s ease;
    outline: none;
}

.modal-close:hover {
    color: #ff0000;
    background: none !important;
}

.modal-close:active {
    background: none !important;
}

.modal-close:focus {
    background: none !important;
    outline: none;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

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

.signatories-grid p {
    margin: 5px 0;
    padding: 0;
    line-height: 1.3;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    gap: 3px;
}

.lang-btn {
    padding: 4px 8px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    text-decoration: none;
    color: #666;
    border-radius: 3px;
    font-weight: normal;
    font-size: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.lang-btn:hover {
    background: rgba(255,255,255,0.95);
    color: #333;
    border-color: #bbb;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.lang-btn.active {
    background: #f8f9fa;
    color: #495057;
    border-color: #adb5bd;
    font-weight: bold;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .language-switcher {
        top: 8px;
        right: 8px;
    }
    
    .lang-btn {
        padding: 3px 6px;
        font-size: 11px;
    }
}