@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700&display=swap');

:root {
    --coral:      #FF6B6B;
    --yellow:     #FFD93D;
    --green:      #6BCB77;
    --blue:       #4D96FF;
    --purple:     #C77DFF;
    --cream:      #FFF5E4;
    --card-bg:    #FFFFFF;
    --text:       #333333;
    --text-light: #666666;
    --radius:     16px;
    --shadow:     0 4px 20px rgba(0,0,0,0.10);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background-color: var(--cream);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  body::before {
    content: '';
    position: fixed;
    top: -120px; right: -120px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(255,107,107,0.15) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
  }
  body::after {
    content: '';
    position: fixed;
    bottom: -100px; left: -100px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(77,150,255,0.12) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
  }
  header {
    background: linear-gradient(135deg, var(--coral) 0%, #ff8e53 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(255,107,107,0.3);
  }
  header::before {
    content: '🏠';
    position: absolute;
    font-size: 8rem;
    opacity: 0.08;
    top: -10px; left: -20px;
    pointer-events: none;
  }
  header h1 {
    font-family: 'Fredoka One', 'Comic Sans MS', cursive;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.15);
  }
  header p.subtitle { font-size: 1.1rem; opacity: 0.9; margin-top: 0.25rem; }
  nav {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky; top: 0; z-index: 100;
  }
  nav ul {
    display: flex; list-style: none; justify-content: center;
    flex-wrap: wrap; gap: 0.25rem; padding: 0.75rem 1rem;
  }
  nav ul li a {
    display: block; padding: 0.5rem 1.25rem;
    border-radius: 50px; text-decoration: none;
    color: var(--text); font-weight: 700; font-size: 0.95rem;
    transition: all 0.2s ease;
  }
  nav ul li a:hover, nav ul li a.active {
    background: var(--coral); color: white; transform: translateY(-1px);
  }
  nav ul li.nav-gallery a:hover, nav ul li.nav-gallery a.active { background: var(--blue); }
  nav ul li.logout-btn a {
    background: var(--cream); color: var(--text-light); font-size: 0.85rem;
  }
  nav ul li.logout-btn a:hover { background: #ffdddd; color: var(--coral); transform: none; }
  main { flex: 1; position: relative; z-index: 1; }
  .content-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 2.5rem;
    margin: 2rem auto; max-width: 860px; width: calc(100% - 2rem);
  }
  .content-card h1, .content-card h2, .content-card h3 {
    font-family: 'Fredoka One', 'Comic Sans MS', cursive;
    color: var(--coral); margin: 1.5rem 0 0.75rem;
  }
  .content-card h1 { font-size: 2rem; }
  .content-card h2 { font-size: 1.6rem; color: var(--blue); }
  .content-card h3 { font-size: 1.3rem; color: var(--green); }
  .content-card p { line-height: 1.8; margin-bottom: 1rem; }
  .content-card ul, .content-card ol { margin: 0.5rem 0 1rem 1.5rem; line-height: 1.8; }
  .content-card a { color: var(--blue); text-decoration: none; }
  .content-card a:hover { text-decoration: underline; }
  .content-card blockquote {
    border-left: 4px solid var(--yellow); background: #fffdf0;
    padding: 0.75rem 1.25rem; border-radius: 0 8px 8px 0;
    margin: 1rem 0; font-style: italic;
  }
  .content-card code {
    background: #f4f4f4; padding: 0.15em 0.4em;
    border-radius: 4px; font-size: 0.9em;
  }
  .content-card pre code { display: block; padding: 1rem; overflow-x: auto; }
  .page-title { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
  footer {
    text-align: center; padding: 1.5rem; background: white;
    color: var(--text-light); font-size: 0.85rem;
    border-top: 3px solid var(--yellow); position: relative; z-index: 1;
  }
  footer span { color: var(--coral); }
  .family-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem; margin: 2rem 0;
  }
  .family-member {
    background: var(--cream); border-radius: var(--radius);
    padding: 1.5rem 1rem; text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .family-member:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .family-member .avatar { font-size: 3.5rem; display: block; margin-bottom: 0.5rem; }
  .family-member .name { font-family: 'Fredoka One', cursive; font-size: 1.3rem; color: var(--coral); }
  .family-member .role { font-size: 0.85rem; color: var(--text-light); margin-top: 0.25rem; }
  .gallery-header { text-align: center; padding: 2rem 1rem 1rem; }
  .gallery-header h1 {
    font-family: 'Fredoka One', 'Comic Sans MS', cursive;
    font-size: clamp(1.8rem, 4vw, 3rem); color: var(--blue);
  }
  .gallery-header p { color: var(--text-light); margin-top: 0.5rem; }
  .album-section { margin: 2rem auto; max-width: 1200px; padding: 0 1rem; }
  .album-title {
    font-family: 'Fredoka One', cursive; font-size: 1.5rem; color: var(--purple);
    margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
  }
  .album-title::after {
    content: ''; flex: 1; height: 2px;
    background: linear-gradient(to right, var(--purple), transparent);
  }
  .photo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem;
  }
  .photo-item {
    border-radius: 12px; overflow: hidden; cursor: pointer;
    position: relative; aspect-ratio: 4/3; background: #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .photo-item:hover { transform: scale(1.03); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
  .photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .photo-item .photo-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0);
    display: flex; align-items: center; justify-content: center; transition: background 0.2s;
  }
  .photo-item:hover .photo-overlay { background: rgba(0,0,0,0.25); }
  .photo-item .photo-overlay span { font-size: 2rem; opacity: 0; transition: opacity 0.2s; }
  .photo-item:hover .photo-overlay span { opacity: 1; }
  .lightbox {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.9);
    z-index: 1000; align-items: center; justify-content: center; flex-direction: column;
  }
  .lightbox.open { display: flex; }
  .lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 8px; object-fit: contain; }
  .lightbox-close {
    position: absolute; top: 1rem; right: 1.5rem; font-size: 2.5rem;
    color: white; cursor: pointer; background: none; border: none; line-height: 1;
  }
  .lightbox-nav { display: flex; gap: 1rem; margin-top: 1rem; }
  .lightbox-nav button {
    background: rgba(255,255,255,0.15); border: none; color: white;
    font-size: 1.5rem; padding: 0.5rem 1.25rem; border-radius: 50px;
    cursor: pointer; transition: background 0.2s;
  }
  .lightbox-nav button:hover { background: rgba(255,255,255,0.3); }
  .lightbox-caption { color: rgba(255,255,255,0.7); font-size: 0.9rem; margin-top: 0.5rem; }
  .login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--cream) 0%, #fce4e4 100%); padding: 1rem;
  }
  .login-box {
    background: white; border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    padding: 3rem 2.5rem; width: 100%; max-width: 420px; text-align: center;
  }
  .login-emoji {
    font-size: 4rem; display: block; margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
  }
  @keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
  }
  .login-box h1 { font-family: 'Fredoka One', cursive; font-size: 2rem; color: var(--coral); margin-bottom: 0.25rem; }
  .login-box .subtitle { color: var(--text-light); margin-bottom: 2rem; font-size: 0.95rem; }
  .login-field { margin-bottom: 1rem; text-align: left; }
  .login-field label { display: block; font-weight: 700; margin-bottom: 0.4rem; font-size: 0.9rem; color: var(--text-light); }
  .login-field input {
    width: 100%; padding: 0.75rem 1rem; border: 2px solid #e8e8e8;
    border-radius: 50px; font-size: 1rem; font-family: inherit;
    outline: none; transition: border-color 0.2s;
  }
  .login-field input:focus { border-color: var(--coral); }
  .login-btn {
    width: 100%; padding: 0.85rem;
    background: linear-gradient(135deg, var(--coral), #ff8e53);
    color: white; border: none; border-radius: 50px;
    font-size: 1.1rem; font-weight: 700; font-family: 'Fredoka One', cursive;
    cursor: pointer; margin-top: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s; letter-spacing: 0.5px;
  }
  .login-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(255,107,107,0.4); }
  .login-error {
    display: none; background: #fff0f0; border: 1px solid #ffcccc;
    border-radius: 8px; padding: 0.75rem; color: var(--coral);
    font-size: 0.9rem; margin-top: 1rem;
  }
  .login-error.show { display: block; }
  .album-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem; max-width: 1200px; margin: 2rem auto; padding: 0 1rem;
  }
  .album-card {
    display: block; text-decoration: none;
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .album-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,0.15); }
  .album-card-thumb {
    aspect-ratio: 4/3; overflow: hidden; background: var(--cream);
    display: flex; align-items: center; justify-content: center;
  }
  .album-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .album-card-thumb .album-card-placeholder { font-size: 3.5rem; }
  .album-card-info { padding: 1rem 1.25rem; }
  .album-card-name {
    display: block; font-family: 'Fredoka One', cursive;
    font-size: 1.2rem; color: var(--purple);
  }
  .album-card-count { display: block; font-size: 0.85rem; color: var(--text-light); margin-top: 0.2rem; }
  .back-link {
    display: inline-block; color: var(--blue); text-decoration: none;
    font-weight: 700; margin-bottom: 1rem; font-size: 0.95rem;
  }
  .back-link:hover { text-decoration: underline; }
  @media (max-width: 600px) {
    .content-card { padding: 1.5rem; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .album-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  }
