/* ============================================
   SAVE ST MALACHY'S PRIMARY SCHOOL - STYLES
   School Colors: Green & Red
   ============================================ */

/* School Color Palette */
:root {
    --pigment-green: #27A036;
    --cal-poly-green: #07590D;
    --seasalt: #FBFBFA;
    --red-cmyk: #E61B23;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #e8e8e8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Website Box */
body > * {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--seasalt);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--pigment-green) 0%, var(--cal-poly-green) 100%);
    color: #fff;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Hero Pattern Effect */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/pattern.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.065;
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 768px) {
    .hero::before {
        background-image: url('../images/vertical_pattern.png');
        background-size: cover;
        opacity: 0.065;
    }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-logo {
    width: 250px;
    height: 250px;
    margin: 0 auto 15px;
    background-color: #fff;
    border-radius: 50%;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-est {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 20px;
    color: #fff;
    opacity: 0.95;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-deadline {
    font-size: 1.125rem;
    background-color: var(--red-cmyk);
    display: inline-block;
    padding: 11px 30px;
    border-radius: 8px;
    margin-top: 8px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(230, 27, 35, 0.4);
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.hero-deadline:hover {
    background-color: #c71820;
}

/* Petition Statement */
.petition-statement {
    background-color: #fff;
    padding: 50px 20px;
}

.statement-box {
    max-width: 1100px;
    margin: 0 auto;
    background-color: var(--seasalt);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid var(--pigment-green);
}

.statement-heading {
    color: var(--red-cmyk);
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.statement-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.statement-text-column {
    flex: 1;
}

.statement-image-column {
    flex: 1;
}

.statement-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.statement-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
}

.statement-text:last-child {
    margin-bottom: 0;
}

@media (max-width: 968px) {
    .statement-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .statement-image-column {
        order: -1;
    }
}

/* Why Section */
.why-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--cal-poly-green) 0%, var(--pigment-green) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Spotlight Effect on Why Section */
.why-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.2) 0%, transparent 50%);
    pointer-events: none;
    animation: moveSpotlight 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes moveSpotlight {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(30%, 20%);
    }
    50% {
        transform: translate(60%, -10%);
    }
    75% {
        transform: translate(20%, 15%);
    }
}

.why-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 50px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.reason-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.reason-item {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid var(--red-cmyk);
    position: relative;
    z-index: 2;
}

.reason-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.reason-item h3 {
    color: var(--cal-poly-green);
    font-size: 1.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.reason-item h3::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--pigment-green);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.2rem;
}

.reason-item.history h3::before {
    content: '📚';
}

.reason-item.education h3::before {
    content: '🎓';
}

.reason-item.community h3::before {
    content: '❤️';
}

.reason-item.nurturing h3::before {
    content: '🌱';
}

.reason-item p {
    color: #333;
    line-height: 1.8;
    font-size: 1.05rem;
}

@media (max-width: 968px) {
    .reason-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .why-section h2 {
        font-size: 2rem;
    }
}

/* Counter Section */
.counter-section {
    background: linear-gradient(135deg, var(--pigment-green) 0%, var(--cal-poly-green) 100%);
    padding: 40px 20px;
    text-align: center;
}

.signature-count {
    color: #fff;
}

.count-number {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.count-label {
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Form Section */
.form-section {
    padding: 60px 20px;
    background-color: #fff;
}

.form-section h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--cal-poly-green);
    margin-bottom: 40px;
}

/* Desktop Table Form */
.petition-form {
    max-width: 1100px;
    margin: 0 auto;
    background-color: var(--seasalt);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-table {
    overflow-x: auto;
    margin-bottom: 30px;
}

.form-table table {
    width: 100%;
    border-collapse: collapse;
}

.form-table th {
    background-color: var(--pigment-green);
    color: #fff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--cal-poly-green);
}

.form-table td {
    padding: 10px;
    border: 1px solid #ddd;
    vertical-align: top;
    background-color: #fff;
}

.form-table input[type="text"],
.form-table textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-table input[type="text"]:focus,
.form-table textarea:focus {
    outline: none;
    border-color: var(--pigment-green);
}

.form-table textarea {
    resize: vertical;
    min-height: 50px;
}

/* Mobile Form */
.petition-form-mobile {
    display: none;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--seasalt);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--cal-poly-green);
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background-color: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--pigment-green);
}

/* Form Consent */
.form-consent {
    margin: 30px 0;
    padding: 20px;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    cursor: pointer;
}

.consent-label input[type="checkbox"] {
    margin-top: 4px;
    cursor: pointer;
}

.consent-label span {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

/* Error Messages */
.error-msg {
    display: block;
    color: var(--red-cmyk);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.btn-submit {
    background-color: var(--red-cmyk);
    color: #fff;
    border: none;
    padding: 15px 50px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(230, 27, 35, 0.3);
}

.btn-submit:hover {
    background-color: #c71820;
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Message */
.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Arrow Indicator */
.arrow-indicator {
    text-align: center;
    margin: 30px 0 20px;
    animation: fadeInArrows 0.5s ease-in;
}

.arrow-indicator .arrow {
    width: 60px;
    height: 60px;
    color: var(--red-cmyk);
    display: inline-block;
    animation: bounceArrow 1.5s ease-in-out infinite;
}

.arrow-indicator .arrow:nth-child(2) {
    animation-delay: 0.2s;
}

.arrow-indicator .arrow:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounceArrow {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

@keyframes fadeInArrows {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Objection Form Toggle */
.objection-toggle-container {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.btn-objection-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background-color: var(--cal-poly-green);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(7, 89, 13, 0.3);
}

.btn-objection-toggle:hover {
    background-color: var(--pigment-green);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(7, 89, 13, 0.4);
}

.btn-objection-toggle svg {
    transition: transform 0.3s ease;
}

.btn-objection-toggle.active svg {
    transform: rotate(180deg);
}

/* Objection Form Section */
.objection-section {
    background-color: #f5f5f5;
    padding: 60px 20px;
}

.objection-section h2 {
    font-size: 2rem;
    color: var(--cal-poly-green);
    margin-bottom: 15px;
    text-align: center;
}

.objection-section > .container > p {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.objection-form {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.objection-field {
    margin-bottom: 30px;
}

.objection-field label {
    display: block;
    font-weight: 700;
    color: var(--cal-poly-green);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.field-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
    line-height: 1.5;
}

.objection-field textarea,
.objection-field input[type="text"],
.objection-field input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.objection-field textarea:focus,
.objection-field input:focus {
    outline: none;
    border-color: var(--pigment-green);
}

.objection-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Share Section */
.share-section {
    padding: 60px 20px;
    background-color: var(--seasalt);
    text-align: center;
}

.share-section h2 {
    font-size: 2rem;
    color: var(--cal-poly-green);
    margin-bottom: 15px;
}

.share-section p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px; /* Modern browsers */
}

/* Firefox compatibility - fallback for gap property */
@supports not (gap: 15px) {
    .share-buttons {
        margin: -7.5px;
    }
    
    .share-buttons .share-btn {
        margin: 7.5px;
    }
}

/* Additional Firefox-specific fixes */
@-moz-document url-prefix() {
    .share-buttons {
        display: -webkit-flex;
        display: -moz-flex;
        display: flex;
        -webkit-justify-content: center;
        -moz-justify-content: center;
        justify-content: center;
        -webkit-flex-wrap: wrap;
        -moz-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    
    .share-buttons .share-btn {
        margin: 0 7.5px 15px 7.5px;
    }
}

.qr-code-container {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Firefox compatibility */
    -webkit-flex-direction: column;
    -moz-flex-direction: column;
    -webkit-align-items: center;
    -moz-align-items: center;
}

.qr-code {
    width: 300px;
    height: 300px;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin: 0 auto;
}

.qr-code img {
    width: 100%;
    height: 100%;
    display: block;
}

.qr-label {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
}

.share-btn svg {
    width: 24px;
    height: 24px;
}

.share-btn.facebook {
    background-color: #1877F2;
}

.share-btn.facebook:hover {
    background-color: #155db2;
}

.share-btn.whatsapp {
    background-color: #25D366;
}

.share-btn.whatsapp:hover {
    background-color: #20bd5a;
}

.share-btn.email {
    background-color: #EA4335;
}

.share-btn.email:hover {
    background-color: #c5372c;
}

/* Footer */
.footer {
    background-color: var(--cal-poly-green);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}

.footer p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer p:last-child {
    margin-bottom: 0;
    opacity: 0.8;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: 45px 20px;
    }

    .hero-logo {
        width: 180px;
        height: 180px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-deadline {
        font-size: 0.9rem;
        padding: 9px 19px;
    }

    .statement-box {
        padding: 25px;
    }

    .statement-text {
        font-size: 1rem;
    }

    .why-section h2,
    .form-section h2,
    .share-section h2 {
        font-size: 1.6rem;
    }

    .reason-item {
        padding: 20px;
    }

    .count-number {
        font-size: 3rem;
    }

    .count-label {
        font-size: 1.1rem;
    }

    /* Hide table form on mobile, show mobile form */
    .petition-form {
        display: none;
    }

    .petition-form-mobile {
        display: block;
    }

    .share-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .share-btn {
        justify-content: center;
    }

    .btn-objection-toggle {
        font-size: 1rem;
        padding: 14px 24px;
    }

    .objection-form {
        padding: 25px;
    }

    .objection-field label {
        font-size: 1rem;
    }

    .field-description {
        font-size: 0.85rem;
    }

    .arrow-indicator .arrow {
        width: 50px;
        height: 50px;
    }
}

/* Print Styles */
@media print {
    .hero,
    .counter-section,
    .share-section,
    .footer,
    .btn-submit,
    .form-consent,
    .arrow-indicator,
    .objection-toggle-container,
    .objection-section {
        display: none;
    }

    .form-table table {
        page-break-inside: avoid;
    }

    body {
        background: #fff;
    }

    .petition-statement,
    .why-section,
    .form-section {
        background: #fff;
        padding: 20px 0;
    }

    .statement-box,
    .petition-form {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Accessibility */
:focus-visible {
    outline: 3px solid var(--pigment-green);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
