
:root {
    --background-color: #CCCCCC; /* Lighter Gray (80%) */
    --text-color: #000000; /* Dark gray for text */
    --button-bg-color: #808080; /* 50% Gray */
    --button-text-color: #ffffff;
    --footer-text-color: #666666; /* Darker gray for footer */
    --font-body: 'Montserrat', sans-serif;
}

html {
    box-sizing: border-box;
    font-size: 16px;
    background-color: var(--background-color); /* Moved from body to ensure logo visibility */
}

*, *:before, *:after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    /* background-color moved to html */
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Conflicting display properties removed to fix layout bugs */
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    inset: 0; /* a shorthand for top, right, bottom, left */
    background-image: url('jis-logo.PNG');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
    mix-blend-mode: multiply; /* Makes the white background of the logo transparent */
    opacity: 0.15; /* Slightly increased for better visibility with blend mode */
    z-index: -1;
}


.container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    width: 100%;
    padding: 2rem;
    text-align: center;
    position: relative; /* Required for z-index */
    z-index: 10; /* Content layer, behind diamonds */
}

.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 650px;
    margin: 0 auto;
    animation: fadeIn 1.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tagline {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-top: 2rem; /* Add space at the top */
    text-shadow: 1px 1px 0 #FFF; /* Added white bottom-right border */
}

.cookie-consent-text {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-color);
    max-width: 550px;
    margin: 0 auto 2.5rem auto;
    line-height: 1.5;
    text-shadow: 1px 1px 0 #FFF; /* Added white bottom-right border */
}

.cta-button {
    display: inline-block;
    font-weight: 400;
    font-size: 1rem;
    text-decoration: none;
    color: var(--button-text-color);
    background-color: var(--button-bg-color);
    padding: 12px 35px;
    border: 2px solid var(--button-bg-color);
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 13.4rem; /* Moved button down by ~400% of its height */
    text-shadow: 1px 1px 0 #606060; /* Added subtle dark bottom-right border for effect */
}

.cta-button:hover,
.cta-button:focus {
    background-color: #606060; /* Darker gray on hover */
    border-color: #606060;
    transform: translateY(-2px);
}

.page-footer {
    width: 100%;
    padding: 1rem 0;
    position: relative; /* For positioning the admin link */
}

.legal-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.legal-links a {
    color: var(--footer-text-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 300;
    transition: color 0.3s ease;
}

.legal-links a:hover {
    color: var(--text-color);
    text-decoration: underline;
}

/* Invisible Admin Login Link */
#admin-login-link {
    display: block;
    width: 250px; /* Increased width to cover the whole text */
    height: 50px;
    /* Pull the following element up into this element's space */
    margin-bottom: -50px; 
    
    /* Ensure the link is layered on top of the text */
    position: relative;
    z-index: 2;
    
    /* Makes the element transparent but still interactive. */
    opacity: 0;

    /* Hides the text "jis". */
    font-size: 0;
    color: transparent;
    text-decoration: none;
    cursor: pointer;
}

/* --- New Diamond Animation Styles --- */
#diamond-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 11;
    pointer-events: none;
}

.diamond-faller {
    position: absolute;
    top: -20vh; /* Start above the viewport */
    animation-name: fall;
    animation-timing-function: linear;
    will-change: transform;
    pointer-events: auto; /* Diamonds themselves are interactive */
    cursor: grab;
}

.diamond-tilt-container {
    width: 100%;
    height: 100%;
    will-change: transform;
}

.diamond-push-container {
    width: 100%;
    height: 100%;
    will-change: transform;
    transition: transform 3.5s ease-in; /* Smooth transition for the push effect */
}

.diamond-tumble-container {
    width: 100%;
    height: 100%;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    will-change: transform;
    transform-style: preserve-3d;
}

.brilliant-svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(1px 1px 0 black) drop-shadow(-1px -1px 0 white);
}

.brilliant-facet {
    fill: white;
    fill-opacity: 1;
    animation-name: random-facet-flash;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.brilliant-center-facet {
    stroke: none;
    animation-name: random-center-facet-flash;
}

.brilliant-outer-facet {
    stroke: none;
}

/* Larger diamonds get a subtle outline for definition */
.is-large .brilliant-outer-facet {
    stroke: black;
    stroke-width: 0.25;
    vector-effect: non-scaling-stroke;
}

@keyframes fall {
    from { transform: translateY(0); }
    to { transform: translateY(140vh); } /* End well below the viewport */
}

@keyframes gentle-tumble-3d-1 {
    0%   { transform: rotate3d(0.5, 0.8, 0.1, -35deg); }
    25%  { transform: rotate3d(-0.2, -0.7, 0.3, 10deg); }
    50%  { transform: rotate3d(0.6, -0.3, -0.2, 35deg); }
    75%  { transform: rotate3d(0.1, 0.9, 0.4, -15deg); }
    100% { transform: rotate3d(0.5, 0.8, 0.1, 35deg); }
}
@keyframes gentle-tumble-3d-2 {
    0%   { transform: rotate3d(0.2, -0.4, 0.9, -35deg); }
    25%  { transform: rotate3d(0.8, 0.1, -0.5, 25deg); }
    50%  { transform: rotate3d(-0.5, 0.8, -0.1, 0deg); }
    75%  { transform: rotate3d(-0.1, -0.6, 0.7, -28deg); }
    100% { transform: rotate3d(0.2, -0.4, 0.9, 35deg); }
}
@keyframes gentle-tumble-3d-3 {
    0%   { transform: rotate3d(-0.9, 0.1, -0.3, -30deg); }
    25%  { transform: rotate3d(0.4, -0.7, -0.6, 30deg); }
    50%  { transform: rotate3d(-0.8, -0.2, 0.5, -10deg); }
    75%  { transform: rotate3d(0.6, 0.3, 0.9, 15deg); }
    100% { transform: rotate3d(-0.9, 0.1, -0.3, 30deg); }
}

@keyframes random-facet-flash {
    0%, 60% {
        fill: white;
    }
    60.1%, 100% {
        fill: black;
    }
}

@keyframes random-center-facet-flash {
    0%, 68% {
        fill: white;
    }
    68.1%, 100% {
        fill: black;
    }
}


@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    .tagline {
        font-size: 1.1rem;
        padding-top: 1rem;
    }
    .cookie-consent-text {
        font-size: 0.85rem;
        margin-bottom: 2rem;
    }
    .legal-links {
        gap: 1rem;
        flex-direction: column;
    }
}

/* --- Admin Page Styles --- */
.admin-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #f4f4f4;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    /* Make container a flex column that takes at least the viewport height */
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 4rem); /* Full viewport height minus top/bottom margin of container */
}

.admin-container h1, .admin-container h2 {
    font-size: 1.8rem;
    font-weight: 700;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.admin-container h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
}

.admin-container p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.admin-container .admin-section {
    margin-bottom: 2rem;
}

/* Use margin-top: auto to push this specific section to the bottom */
.admin-container .admin-section.pushed-to-bottom {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
    margin-bottom: 0; /* Override the default margin-bottom for the last section */
}

.admin-container .admin-actions {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.admin-container button,
.admin-container .admin-button {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--button-text-color);
    background-color: var(--button-bg-color);
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.admin-container button:hover,
.admin-container .admin-button:hover {
    background-color: #606060;
}

/* Table styles */
#visit-table-container {
    border: 1px solid #ddd;
    border-radius: 5px;
}

#visit-table {
    width: 100%;
    border-collapse: collapse;
}

#visit-table th, #visit-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#visit-table th {
    background-color: #e9e9e9;
    font-weight: 700;
    position: sticky;
    top: 0;
}

#visit-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.email-config-form .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Email form styles */
.email-config-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.email-config-form input[type="email"] {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.email-config-form .status-message {
    margin-top: 1rem;
    padding: 10px;
    border-radius: 5px;
    font-weight: 700;
}
.email-config-form .status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.email-config-form .status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* --- Password Prompt Styles --- */
.hidden {
    display: none !important;
}

#password-prompt-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.password-box {
    background-color: #f4f4f4;
    color: var(--text-color);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.password-box h1 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.password-box p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

#password-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
}

#password-form button {
    width: 100%;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    color: var(--button-text-color);
    background-color: var(--button-bg-color);
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#password-form button:hover {
    background-color: #606060;
}

.error-message {
    color: #d93025;
    margin-top: 1rem;
    font-weight: 700;
}