﻿/* Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS. */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    line-height: 1.5;
}

* {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* Signed in/out item divs - hidden by default, JavaScript will toggle visibility */
#signed-in-lost-item-div,
#signed-in-found-item-div {
    display: none;
}

#signed-out-lost-item-div,
#signed-out-found-item-div {
    display: block;
}

:root {
    /* Color Variables */
    --color-primary: #5C9EAD;
    --color-primary-dark: #326273;

    --color-accent: #E39774;

    --color-black: #000;
    --color-white: #FFF;

    --color-dark-gray: #808080;
    --color-light-gray: #d9d9d9;

    --color-background: #FFFFFF;

    --color-surface: #EEEEEE;

    /* Font Variables */
    --font-display: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    /* 4px */
    --space-sm: 0.5rem;
    /* 8px */
    --space-md: 1rem;
    /* 16px */
    --space-lg: 1.5rem;
    /* 24px */
    --space-xl: 2rem;
    /* 32px */
    --space-2xl: 3rem;
    /* 48px */
    --space-3xl: 4rem;
    /* 64px */

    /* Fluid Typography Scale */
    --font-size-sm: clamp(0.875rem, 0.8rem + 0.25vw, 1rem);
    --font-size-base: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
    --font-size-lg: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --font-size-xl: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    --font-size-2xl: clamp(2rem, 1.5rem + 1.5vw, 2.5rem);
    --font-size-3xl: clamp(2.5rem, 2rem + 2vw, 3.5rem);
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--color-background);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

main {
    z-index: 100;
    flex: 1 0 auto;
}

h1 {
    font-family: var(--font-display);
    font-weight: 600;
}

/* ==================== Header ==================== */

#mobile-header {
    display: none;
}

header {
    height: 5rem;
}

/* ==================== Navigation ==================== */

.nav-icon {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
    transition: fill 0.2s ease, transform 0.2s ease;
}

/* Remove fill from inline SVGs in HTML */
.nav-icon[xmlns] {
    fill: none;
}

nav a:hover .nav-icon {
    fill: var(--color-primary-dark);
    transform: scale(1.15);
}

nav a:active .nav-icon {
    transform: scale(0.95);
}

/* ==================== Main ==================== */

main {
    margin-left: 0;
    min-height: 150vh;
}

section#hero {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

section#hero img {
    display: none;
    width: 100%;
    height: auto;
}

section#hero video#hero-video {
    z-index: 1;
    width: 100%;
    height: 60vh;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

section#hero h1 {
    position: static;
    z-index: 100;
    left: auto;
    right: auto;
    margin-bottom: 1.5rem;
    font-size: var(--font-size-3xl);
    color: var(--color-primary-dark);
}

/* Background card for hero section contrast */
.hero-card {
    position: absolute;
    z-index: 100;
    top: 50%;
    left: 50%;
    max-width: 90%;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

div.section-header h2 {
    font-family: var(--font-display);
}

section#info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--color-primary);
}

div#carousel {
    width: 100%;
    border-radius: 8px;
    border: solid 1px #000;
}

div#description {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-size: 1rem;
    color: var(--color-light-gray);
}

#typewriter {
    display: inline-block;
    min-width: 6.7ch;
    /* Magic number to prevent layout shift when typing */
    text-align: left;
    vertical-align: bottom;
    color: var(--color-white);
    text-transform: lowercase;
    font-family: var(--font-display);
}

#typewriter::after {
    content: "|";
    margin-left: 4px;
    animation: blink 1.3s infinite;
}

@keyframes blink {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0;
    }
}

div#overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    background-color: var(--color-dark-gray);
    opacity: 0.5;
}

/* ==================== How It Works Section ==================== */

section#how-it-works {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

section#how-it-works h2 {
    font-size: var(--font-size-xl);
}

.steps-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    width: 100%;
    max-width: 1200px;
    margin-top: 2rem;
}

.step-card {
    width: 30%;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 500;
    background-color: var(--color-light-gray);
}

.step-card h3 {
    font-family: var(--font-display);
    font-weight: 400;
}

.step-card p {
    font-family: var(--font-body);
    font-weight: 300;
}

.step-icon {
    margin-bottom: 1rem;
    font-size: 2rem;
}

/* ==================== Impact Stats Section ==================== */

section#impact-stats {
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    background-color: var(--color-accent);
}

.stats-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

.stat-item {
    min-width: 200px;
    padding: 1rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 500;
}

/* ==================== CTA Section ==================== */

section#call-to-action {
    padding: 2rem;
    text-align: center;
    background-color: var(--color-light-gray);
}

section#call-to-action h2 {
    margin-bottom: 1rem;
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-weight: 500;
}

.btn-primary,
.btn-secondary {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin: 1rem;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    font-size: var(--font-size-base);
    text-decoration: none;
    color: white;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--color-primary-dark);
}

.btn-secondary {
    background-color: var(--color-primary);
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary:active,
.btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary::before,
.btn-secondary::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    background: linear-gradient(135deg, #74e6ff, #6291ff);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    opacity: 0.1;
}

/* ==================== Lost Item Section ==================== */

.page-header {
    display: block;
    text-align: center;
}

.page-header h1 {
    font-size: var(--font-size-3xl);
}

/* If the user is signed in do this */
#signed-out-lost-item-div {
    display: none;
}

#signed-in-lost-item-div {
    display: flex;
}

.upload-form {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    text-align: center;
    border-radius: 6px;
    background-color: var(--color-surface);
    box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
    max-width: 80vw;
    padding: 1rem;
    border-top: 4px solid var(--color-primary);
}

.item-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin: 0 auto;
    text-align: left;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-sizing: border-box;
}

.item-form label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.item-form input,
.item-form select,
.item-form textarea {
    margin-top: 0.3rem;
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid var(--color-light-gray);
    background: var(--color-background);
}

.item-form input[type="submit"] {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin: 1rem;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    font-size: var(--font-size-base);
    text-decoration: none;
    color: white;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    border: none;
    background-color: var(--color-primary);
    width: auto;
    min-width: 200px;
    align-self: center;
}

.item-form input:active {
    outline: none;
}

#photo-hint {
    font-size: var(--font-size-sm);
    margin: 0;
}

#tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.tag-pill {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    background-color: var(--color-primary);
    color: white;
    border-radius: 999px;
    font-size: 0.85rem;
    font-family: var(--font-body);
}

.tag-pill button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

/* ==================== Image Upload Preview ==================== */

#image-preview-container {
    display: none;
    position: relative;
    width: fit-content;
    margin-top: 0.5rem;
}

#image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    display: block;
}

#image-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: rgba(0, 0, 0, 0.55);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.2s ease;
}

#image-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--color-dark-gray);
    margin-top: 0.25rem;
}

/* ==================== Search Form ==================== */

.search-bar {
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    text-align: center;
    border-radius: 6px;
    background-color: var(--color-surface);
    box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
    max-width: 80vw;
    padding: 1rem;
    border-top: 4px solid var(--color-primary);
    max-width: 80vw;
}

.secondary-search-items {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
}

.secondary-search-items label {
    flex: 1 1 0;
    min-width: 0;
}

/* Fix the form items not lining up and filling the whole width */

/* ==================== Footer ==================== */

footer {
    width: 100%;
    padding: 0.5rem;
    margin-top: 1rem;
    text-align: center;
    color: white;
    background-color: var(--color-primary-dark);
}

.footer-brand {
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 600;
}

.footer-brand h3 {
    font-size: 1.6rem;
}

.footer-brand p {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
}

/* ==================== Reduced Motion Support ==================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================ */

/* Initial state - hidden and shifted */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Visible state - triggered by JavaScript */
.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for children */
.step-card.scroll-animate:nth-child(1) {
    transition-delay: 0.1s;
}

.step-card.scroll-animate:nth-child(2) {
    transition-delay: 0.2s;
}

.step-card.scroll-animate:nth-child(3) {
    transition-delay: 0.3s;
}

.stat-item.scroll-animate:nth-child(1) {
    transition-delay: 0.1s;
}

.stat-item.scroll-animate:nth-child(2) {
    transition-delay: 0.2s;
}

.stat-item.scroll-animate:nth-child(3) {
    transition-delay: 0.3s;
}

/* Disable for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .scroll-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==================== Login Styles ==================== */

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    background-color: #FFFFFF;
    color: #1f1f1f;
    border: 1px solid #747775;
    border-radius: 20px;
    padding: 0.6rem 1rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
    margin: 1rem auto;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.google-btn:hover {
    background-color: #F8F9FA;
    /* Google's grey hover */
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    border-color: #dadce0;
}

.google-btn:active {
    background-color: #f1f3f4;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
}

.google-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

/* Required Fields */
.required-asterisk {
    color: #d93025;
    margin-left: 2px;
}

.or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 500px;
    margin: 1.5rem auto;
    color: var(--color-dark-gray);
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-light-gray);
}

.or-divider span {
    padding: 0 10px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
}

.auth-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--color-primary-dark);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

.item-form {
    gap: 1.5rem;
}

.upload-form {
    padding: 2rem 1rem;
}
/* ==================== ACCOUNT PAGE ==================== */

.user-profile {
    background-color: var(--color-surface);
    padding: var(--space-xl) 0;
    margin-bottom: var(--space-xl);
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-md);
}

.user-avatar-placeholder svg {
    width: 6rem;
    height: 6rem;
    color: var(--color-primary);
}

.user-info h2 {
    margin: 0;
    font-size: var(--font-size-xl);
    color: var(--color-primary-dark);
}

.user-info p {
    margin: var(--space-xs) 0;
    color: var(--color-dark-gray);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge.verified {
    background-color: #d1fae5;
    color: #065f46;
}

.badge.unverified {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Listings Section */
.user-listings {
    padding-bottom: var(--space-2xl);
}

.user-listings .container {
    padding: 0 var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
    flex-direction:column;
}

.section-header h2 {
    font-size: var(--font-size-lg);
    color: var(--color-primary-dark);
    margin: 0;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

/* Listing Card */
.listing-card {
    background: var(--color-white);
    border: 1px solid var(--color-light-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-image {
    position: relative;
    height: 200px;
    background-color: var(--color-surface);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-badge.lost {
    color: #dc3545;
    border: 1px solid #dc3545;
}

.status-badge.found {
    color: #28a745;
    border: 1px solid #28a745;
}

.card-content {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    margin: 0 0 var(--space-sm);
    font-size: 1.1rem;
    color: var(--color-black);
}

.card-content .meta {
    font-size: 0.9rem;
    color: var(--color-dark-gray);
    margin-bottom: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-content .actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.btn-delete {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #dc3545;
    color: white;
}

.empty-state {
    text-align: center;
    color: var(--color-dark-gray);
    padding: var(--space-xl);
    background: var(--color-surface);
    border-radius: 8px;
    margin-top: var(--space-lg);
}

.listings-footer {
    display: flex;
    justify-content: center;
    margin-top: var(--space-xl);
}

/* ==================== USER SETTINGS SECTION ==================== */

.user-settings {
    margin-bottom: var(--space-2xl);
    background-color: var(--color-background);
}

.user-settings .container {
    padding: 0 var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.settings-card {
    background: var(--color-white);
    border: 1px solid var(--color-light-gray);
    border-radius: 8px;
    padding: var(--space-lg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.settings-card h3 {
    margin-top: 0;
    margin-bottom: var(--space-md);
    color: var(--color-primary-dark);
    font-size: 1.25rem;
    border-bottom: 2px solid var(--color-surface);
    padding-bottom: var(--space-sm);
}

.settings-card form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.settings-card label {
    font-weight: 500;
    color: var(--color-black);
    font-size: 0.95rem;
}

.settings-card input {
    padding: 10px;
    border: 1px solid var(--color-dark-gray);
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
}

.settings-card input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(92, 158, 173, 0.2);
}

.settings-card button {
    margin-top: var(--space-sm);
    align-self: flex-start;
    padding: 10px 20px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.settings-card button:hover {
    background-color: var(--color-primary-dark);
}
