@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

/* --- START: Loading Screen Animation --- */

#loading-screen {
    position: fixed; /* Cover the entire screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000; /* Black background to match the theme */
    display: flex;
    justify-content: center; /* Center the logo horizontally */
    align-items: center; /* Center the logo vertically */
    z-index: 9999; /* Ensure it is on top */
    transition: opacity 0.75s ease-out; /* Smooth fade-out */
}

.netflix-logo {
    font-size: 4rem;
    font-weight: bold;
    color: #e50914; /* Netflix Red */
    font-family: 'Montserrat', sans-serif; /* Use the main site font */
}

/* Individual letter styling for the animation */
.netflix-logo .letter {
    display: inline-block;
    opacity: 0;
    transform: scale(0.5);
    animation: pop-in 0.5s forwards;
}

/* Stagger the animation delay for each letter */
.netflix-logo .letter:nth-child(1) { animation-delay: 0.1s; }
.netflix-logo .letter:nth-child(2) { animation-delay: 0.2s; }
.netflix-logo .letter:nth-child(3) { animation-delay: 0.3s; }
.netflix-logo .letter:nth-child(4) { animation-delay: 0.4s; }
.netflix-logo .letter:nth-child(5) { animation-delay: 0.5s; }
.netflix-logo .letter:nth-child(6) { animation-delay: 0.6s; }
.netflix-logo .letter:nth-child(7) { animation-delay: 0.7s; }

/* Keyframes for the pop-in animation */
@keyframes pop-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- END: Loading Screen Animation --- */


/* --- Main Stylesheet (Your Original Code) --- */

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #141414;
    color: #fff;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Hides the main content until loading is done */
main, header, footer {
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
    animation-delay: 1.5s; /* Delay until after loading animation */
}

header {
    background: url('https://images8.alphacoders.com/108/thumb-1920-1084298.png') no-repeat center center/cover;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

header h1 {
    font-size: 5rem;
    margin: 0;
    letter-spacing: 10px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

header p {
    font-size: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

main {
    padding: 2rem;
}

section {
    padding: 2rem 0;
    border-bottom: 1px solid #333;
    animation: slideUp 1s ease-out;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
}

#intro p {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.character-card {
    background-color: #1f1f1f;
    padding: 1.5rem;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.character-card h3 {
    margin-top: 0;
    color: #e50914; /* Netflix Red */
}

#timeline ul {
    list-style: none;
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
}

#timeline li {
    background-color: #1f1f1f;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #e50914;
}

#family-trees {
    text-align: center;
}

.family-tree-images a {
    color: #e50914;
    text-decoration: none;
    font-weight: bold;
}

.family-tree-images a:hover {
    text-decoration: underline;
}

/* Character Gallery */
#character-gallery {
    padding: 2rem 0;
    background: #181818;
    animation: fadeIn 1.5s;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}
.gallery-item {
    background: #232323;
    border-radius: 8px;
    text-align: center;
    padding: 1rem 1rem 0.5rem 1rem;
    transition: transform 0.4s, box-shadow 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.gallery-item:hover {
    transform: translateY(-12px) scale(1.04);
    box-shadow: 0 12px 36px #e50914bb;
}
.gallery-item img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 6px 6px 0 0;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px #000;
    transition: opacity 0.5s;
    opacity: 0.92;
}
.gallery-item h3 {
    color: #e50914;
    font-size: 1.3rem;
    margin-bottom: 8px;
}

/* Timeline & Family Images */
#visual-timeline, #family-tree-section {
    background: #121212;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 20px #2226;
    text-align: center;
    animation: slideUp 1.2s;
}
.timeline-img, .family-img {
    padding: 1.5rem;
}
.timeline-img img, .family-img img {
    max-width: 90%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 6px 24px #000c;
    margin-bottom: 1rem;
    transition: filter 0.4s;
}
.timeline-img img:hover, .family-img img:hover {
    filter: brightness(1.18) drop-shadow(0 0 8px #e50914bb);
}
.timeline-img p, .family-img p {
    color: #eee;
    font-size: 1.1rem;
}
.timeline-img a, .family-img a {
    color: #e50914;
    font-weight: bold;
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    color: #777;
}

/* Original Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
