/**
 * 東大ドラえもんF同好会 - スタイルシート (CSS)
 *
 * デザインコンセプト：
 * 「ドラえもんの未来感」と「親しみやすさ」を両立させた
 * ホワイトベースのブライト・グラスモルフィズムデザインです。
 *
 * メンテナー向け：
 * - 色の変更は :root 変数 (--primary, --accent 等) を編集してください。
 * - 基本的なレイアウトは .container (max-width: 1200px) で制御されています。
 * - レスポンシブ対応は各セクションの末尾、または @media クエリを確認してください。
 */

:root {
    /* Doraemon Colors */
    --primary: #0096D6;
    /* Doraemon Blue */
    --accent: #EE2C4A;
    /* Nose/Tail Red */
    --highlight: #FDB615;
    /* Bell Yellow */
    --white: #FFFFFF;

    /* Future Bright Theme */
    --bg-light: #F0F8FF;
    /* Alice Blue - very light blue */
    --text-dark: #334155;
    /* Slate 700 */
    --text-muted: #64748b;

    /* Glassmorphism Bright */
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-hover: rgba(255, 255, 255, 0.9);
    --shadow-soft: 0 10px 30px rgba(0, 150, 214, 0.15);

    --transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html {
    scroll-padding-top: 100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    /* Dotted pattern for a technical but bright feel */
    background-image:
        radial-gradient(var(--primary) 1px, transparent 1px);
    background-size: 40px 40px;
    /* Sticky Footer */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Glassmorphism Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 0;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: transform 1.0s cubic-bezier(0.2, 0.8, 0.2, 1);
}

header.header-hidden {
    transform: translateY(-100%);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 400px) {
    .logo {
        font-size: 1.2rem;
    }
}

.logo::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    flex-shrink: 0;
}

.logo::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: var(--highlight);
    border-radius: 50%;
    margin-left: -5px;
    border: 2px solid var(--white);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
    /* Ensure all items link About, History etc are vertically centered */
}

/* Social Links Styles */
.social-links-group {
    display: flex;
    gap: 0.5rem;
    /* Closer gap for icons */
    align-items: center;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    padding-left: 2rem;
    margin-left: 1rem;
}

.nav-links .social-links-group a {
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.nav-links a:hover {
    color: var(--primary);
    background: rgba(0, 150, 214, 0.1);
    box-shadow: none;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(0, 150, 214, 0.05) 0%, transparent 70%);
    z-index: -1;
    border-radius: 50%;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* Section Styling */
section {
    padding: 8rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

/* Timeline/History */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    height: 100%;
    background: rgba(0, 150, 214, 0.2);
    transform: translateX(-50%);
}

.timeline-item {
    margin-bottom: 4rem;
    position: relative;
    width: 50%;
    padding: 0 2rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 150, 214, 0.1);
}

.timeline-dora {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--white);
    border: 4px solid var(--primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    /* Center relative to timeline line */
    transform: translate(-50%, -50%);
    /* Adjust for size */
    z-index: 10;
}

.timeline-item:nth-child(odd) .timeline-dora {
    left: 100%;
}

.timeline-item:nth-child(even) .timeline-dora {
    left: 0;
}

.timeline-date {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Cards/Activities */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 2rem;
    border: none;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 150, 214, 0.05);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    background: var(--white);
    box-shadow: 0 20px 40px rgba(0, 150, 214, 0.15);
}

.card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.card a:not(.btn) {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.card a:not(.btn):hover {
    color: var(--accent);
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 4rem 0;
    color: #64748b;
    background: var(--glass);
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        text-align: left !important;
        padding-left: 2rem;
    }

    .timeline-item:nth-child(odd) .timeline-dora {
        left: 0;
    }
}

/* Animations */
/* Activity Cards Updates */
.activity-card {
    padding: 0;
    /* Remove padding for image */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.activity-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 4px solid var(--primary);
}

.activity-content {
    padding: 1.5rem;
}

.activity-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    display: block;
}

.read-more {
    margin-top: 1rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more span {
    transition: transform 0.3s ease;
}

.card:hover .read-more span {
    transform: translateX(5px);
}

/* Hamburger Menu & Mobile Nav */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary);
    margin: 5px 0;
    transition: var(--transition);
}

/* Mobile Media Query Updates */
@media (max-width: 1024px) {
    .hamburger {
        display: block;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        background: rgba(255, 255, 255, 0.95);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
        backdrop-filter: blur(20px);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
        /* Adjusted from 2rem for better fit */
    }

    .social-links-group {
        margin-top: 1rem;
        border-left: none;
        padding-left: 0;
        margin-left: 0;
    }
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item.fade-in:nth-child(odd) {
    transform: translateX(-20px);
}

.timeline-item.fade-in:nth-child(even) {
    transform: translateX(20px);
}

.timeline-item.fade-in.visible {
    transform: translateX(0);
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 150, 214, 0.4);
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    opacity: 0;
    z-index: -1;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(238, 44, 74, 0.4);
}

.btn:hover::before {
    opacity: 1;
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Loading Screen */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading.loaded {
    opacity: 0;
    visibility: hidden;
}

.loading-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    animation: pulse 2s infinite ease-in-out;
    /* Ensure child SVG fits */
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-icon svg {
    width: 100%;
    height: 100%;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 150, 214, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(0, 150, 214, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 150, 214, 0);
    }
}

/* Activity Detail Page Spacing */
.activity-detail {
    padding-top: 2rem;
    padding-bottom: 8rem;
}

/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.gallery-item:hover {
    transform: scale(1.03);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(0, 150, 214, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}