/* --- Foundational Resets & Variables --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --black: #000;
    --white: #fff;
    --gray-100: #f7f7f7;
    --gray-200: #e9e9e9;
    --gray-900: #1a1a1a;
    --gradient-primary: linear-gradient(63deg,#2461be 20.9%,#d48ba7 38.86%,#e49f45 57.8%,#396126 77.13%,#2461be 95.12%);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    color: var(--black);
    font-family: 'Messina Sans', Helvetica Neue, Helvetica, Arial, sans-serif;
    font-weight: 400;
    letter-spacing: .03em;
    line-height: 1.5;
}

@media screen and (max-width: 767px) {
    html {
        font-size: 12px;
    }
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
    min-height: 100vh;
    line-height: 1.5;
    background-color: var(--white);
}

button {
    background: none;
    border: none;
    margin: 0;
    outline: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* --- Button Primary Style --- */
.button--primary {
    background: var(--white);
    border: 3px solid black;
    box-shadow: -1px 1px 0 0 var(--black),-2px 2px 0 0 var(--black),-3px 3px 0 0 var(--black),-4px 4px 0 0 var(--black),-5px 5px 0 0 var(--black);
    cursor: pointer;
    display: inline-flex;
    padding: 0;
    position: relative;
    transition: all 0.3s ease, transform 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
    overflow: hidden;
    z-index: 2;
    width: 100%;
    height: 120px;
    margin: 0 auto;
}

/* Main buttons in the button container */
.button-container .button--primary {
    height: 240px; /* Doubled height for main buttons */
}

/* Alliance for Hope button */
.button--primary[data-url*="allianceforhope"] {
    background-color: #f9dd62;
}

/* DomesticShelters button */
.button--primary[data-url*="domesticshelters"] {
    background-color: #501843;
}

/* Adjust text color for dark background */
.button--primary[data-url*="domesticshelters"] .button-text-label {
    color: var(--white);
}

/* Inner wrapper for image/text */
.button-content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: 100%;
}

.button-image-container {
    width: 120px;
    height: 100%;
    background: #F9F6E9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Main buttons image container */
.button-container .button-image-container {
    width: 240px; /* Doubled width for main buttons */
}

.button-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.button-text-container {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    min-width: 0;
}

.button-text-label {
    font-size: 1.75rem;
    line-height: 1.3;
    color: var(--black);
    font-weight: 600;
    text-align: left;
    white-space: normal;
}

/* Hover state */
.button--primary:not([disabled]):focus-visible,
.button--primary:not([disabled]):hover {
    outline: none;
    box-shadow: none;
    transform: translate(-5px, 5px);
}

/* --- Layout & Custom Styles --- */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    padding: 0 15px;
}

/* Modal styles */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 1000;
}

.modal-container.open {
    display: flex;
}

#modal-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 2px solid var(--black);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
}

.modal-content {
    width: 100%;
    height: 100%;
    padding-top: 60px;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Back button specific styles */
#modal-back-btn.button--primary {
    height: auto;
    width: auto;
    min-width: unset;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    margin: 0.5rem 0;
    border: 2px solid var(--black);
    box-shadow: -1px 1px 0 0 var(--black),-2px 2px 0 0 var(--black);
}

#modal-back-btn.button--primary:hover {
    box-shadow: none;
    transform: translate(-2px, 2px);
}

#countdown-timer {
    font-size: 1rem;
    font-weight: 600;
    color: var(--black);
}

.toolbar-right {
    display: none;
}

.toolbar-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--black);
}

.toolbar-btn:hover {
    opacity: 0.7;
}

/* Update modal-close-btn to match toolbar-btn */
#modal-close-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    line-height: 1;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--black);
}

#modal-close-btn:hover {
    opacity: 0.7;
}

/* Utility class */
.hidden {
    display: none !important;
}

/* Add new keyframes for animations */
@keyframes gradientBorder {
    0% { border-image-source: linear-gradient(45deg, #2461be, #d48ba7); }
    25% { border-image-source: linear-gradient(45deg, #d48ba7, #e49f45); }
    50% { border-image-source: linear-gradient(45deg, #e49f45, #396126); }
    75% { border-image-source: linear-gradient(45deg, #396126, #2461be); }
    100% { border-image-source: linear-gradient(45deg, #2461be, #d48ba7); }
}

/* Add particle container styles */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    pointer-events: none;
    mix-blend-mode: screen;
}


/* Add smooth entrance animation for the landing container */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Update gradient animation keyframes */
@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
        background-size: 200% 200%;
    }
    50% {
        background-position: 100% 50%;
        background-size: 200% 200%;
    }
    100% {
        background-position: 0% 50%;
        background-size: 200% 200%;
    }
}

/* Tablet breakpoint */
@media screen and (min-width: 768px) {
    .landing-container {
        padding: 40px;
    }
    
    .button-container {
        gap: 30px;
    }
    
    .button-container .button--primary {
        height: 280px; /* Doubled height for main buttons on tablet */
    }
    
    .button-container .button-image-container {
        width: 280px; /* Doubled width for main buttons on tablet */
    }
    
    .button-text-label {
        font-size: 2rem;
    }
}

@media screen and (min-width: 1200px) {
    .button-container {
        gap: 40px;
    }
    
    .button-container .button--primary {
        height: 320px; /* Doubled height for main buttons on desktop */
    }
    
    .button-container .button-image-container {
        width: 320px; /* Doubled width for main buttons on desktop */
    }
    
    .button-text-label {
        font-size: 2.25rem;
    }
}

@media screen and (max-width: 767px) {
    .button-container .button--primary {
        height: 200px; /* Doubled height for main buttons on mobile */
    }
    
    .button-container .button-image-container {
        width: 200px; /* Doubled width for main buttons on mobile */
    }
    
    #modal-toolbar {
        padding: 0 15px;
    }
    
    #modal-back-btn.button--primary {
        padding: 0.25rem 0.75rem;
        font-size: 0.875rem;
    }
    
    #countdown-timer {
        font-size: 0.875rem;
    }
    
    .modal-content {
        padding-top: 50px;
    }
}

.fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--black);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.fullscreen-btn:hover {
    opacity: 0.7;
}