/*
  styles.css - Graduation Invitation Styling
  Purpose: Provides responsive, accessible, and visually appealing styles
           for the animated envelope and invitation content.
  Author: Cayleigh Leishman
  Project: Graduation Invitation
*/

/* ===================================================================
   Root Variables
   Define theme colors, fonts, and reusable styling constants
================================================================== */
:root {
    --primary-color: #006EB6; /* Main accent color (blue) */
    --secondary-color: #d9e1e8; /* Soft, shiny silver tone */
    --background-color: #e9ede9; /* Light neutral background */
    --white: #fff; /* White color for backgrounds and contrast */
    --text-color: #333; /* Default text color for readability */
    --envelope-color: #a1d2f7; /* Envelope body color */
    --envelope-flap-color: #006EB6; /* Envelope flap color */
    --heart-color: #fb6f92; /* Pink accent for heart seal and emphasis */
    --font-family: 'Lato', 'Arial', sans-serif; /* Primary font stack */
    --heading-font: 'Playfair Display', 'Georgia', serif; /* Elegant heading font */
    --box-shadow: 0px 4px 6px rgba(13, 33, 23, 0.678); /* Depth shadow for elements */
    --transition: all 0.3s ease; /* Smooth transition for hover effects */
}

/* ============================================================
   Global Reset and Body Styling
   Ensures consistent spacing and basic layout styling
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-box: border-box; /* (Note: should be box-sizing: border-box) */
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--background-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ============================================================
   Main Navigation Bar
   Fixed, responsive navigation with hover and focus effects
=============================================================== */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--primary-color);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
}

.main-nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: var(--transition);
}

.main-nav a:hover,
.main-nav a:focus {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.main-nav a.active {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* =============================================================
   Envelope Animation Section
   Contains the clickable animated envelope and opening motion
================================================================ */
#envelope-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 6rem;
    gap: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

#envelope-container:hover {
    transform: scale(1.05);
}

.envelope {
    position: relative;
    width: 280px;
    height: 180px;
    perspective: 1000px; /* Enables 3D rotation */
}

.envelope-body {
    width: 100%;
    height: 100%;
    background-color: var(--envelope-color);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 140px solid transparent;
    border-right: 140px solid transparent;
    border-top: 90px solid var(--envelope-flap-color);
    transform-origin: top center;
    transition: transform 0.6s ease;
}

/* Envelope opening animation */
#envelope-container.opening .envelope-flap {
    transform: rotateX(-180deg);
}

/* Heart seal decoration */
.heart-seal {
    color: var(--heart-color);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* =================================================================
   Invitation Content
   Hidden until envelope is opened; includes details and RSVP form
==================================================================== */
#invitation-content {
    max-width: 900px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
    display: none;
    animation: fadeIn 0.8s ease;
}

/* Visible when envelope is opened */
#invitation-content.visible {
    display: block;
}

/* =====================================
   Close Button
   Used to close the invitation view
======================================== */
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--secondary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary-color);
}

.close-btn:hover{
    background: var(--primary-color);
    color: var(--white);
}
/* ========================================
   Header and Hero Section
   Includes main title and description
========================================== */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--secondary-color);
}

h1 {
    font-family: var(--heading-font);
    color: var(--primary-color);
    font-size: 2rem;
}

/* ======================================================
   Event Details Grid
   Displays key details such as date, time, and location
==========================================================*/
.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.detail-item {
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* =======================================================
   RSVP Form
   Collects guest responses with accessible form elements
===========================================================*/
#rsvp-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===============================================
   Gift Registry Section
   Displays registry links and information cards
================================================== */
.gift-registry-section {
    background: linear-gradient(135deg, rgba(58, 90, 64, 0.05) 0%, rgba(227, 213, 202, 0.1) 100%);
    padding: 2rem 1.5rem;
    border-radius: 12px;
}

.registry-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* ===============================================
   Countdown Timer
   Displays remaining time until graduation event
=================================================== */
.countdown {
    margin-top: 2rem;
    text-align: center;
}
@media (min-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    .hero-description {
        font-size: 1.25rem;
    }
}

.countdown {
    margin-top: 2rem;
    text-align: center;
}

.countdown-label {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.countdown-timer {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.time-unit {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    min-width: 80px;
}

.time-unit span:first-child {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--heading-font);
}

.time-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}


/* =============================================================
   Resources and Chats Pages
   Additional sections for related content and communication
================================================================ */
.resources-main,
.chats-main {
    max-width: 900px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    padding: 3rem 2rem;
    margin: 2rem auto;
}


/* =====================================================
    registraton anchor links
    =========================================*/
    /* For all registry buttons */
.btn-registry {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.btn-registry:hover,
.btn-registry:focus {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  color: var(--primary-color); /* Keep text readable */
}

/* =========================================
   Footer Section
   Contains closing note and site credits
============================================ */
.site-footer {
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    padding: 2rem 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* for anchor links */

/* For footer link */
.footer-links a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-links a:focus {
  color: #4158d0; /* Change color on hover, like nav */
}


/* ============================================
 Print Styles
   Optimizes layout for printed invitations
=============================================== */
@media print {
    body {
        background: var(--white);
        padding-top: 0;
    }

    .main-nav, .site-footer, #envelope-container {
        display: none;
    }

    #invitation-content {
        display: block !important;
        box-shadow: none;
        max-width: 100%;
    }
}
