@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500&display=swap');

:root {
    --bg-color: #080808;
    --text-color: #FDFBF7;
    --accent-color: #D4AF37; /* Gold */
    --accent-hover: #b8962b;
    --border-color: #333333;
    --font-japanese: 'Noto Serif JP', 'Yu Mincho', 'Shippori Mincho', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-japanese);
    line-height: 1.6;
}

body.view-body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

/* --- Index (View) Page Styles --- */
.view-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Background subtly animated pattern / gradient */
.view-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    z-index: -2;
}

/* Top and Bottom Gradients for better text readability */
.view-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom, 
        rgba(0, 0, 0, 1) 0%, 
        rgba(0, 0, 0, 0.8) 15%, 
        rgba(0, 0, 0, 0.4) 25%, 
        rgba(0, 0, 0, 0) 40%, 
        rgba(0, 0, 0, 0) 60%, 
        rgba(0, 0, 0, 0.4) 75%, 
        rgba(0, 0, 0, 0.8) 85%, 
        rgba(0, 0, 0, 1) 100%
    );
    z-index: 0;
    pointer-events: none;
}

#image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: -1;
}

#image-display {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: scale(1.0);
    transition: opacity 2s ease-in-out, transform 20s ease-out;
    object-fit: cover;
}

#image-display.show {
    opacity: 1;
    transform: scale(1.05); /* Slow Ken Burns effect */
    transition: opacity 4s ease-in-out, transform 20s ease-out;
}

#info-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 20;
    pointer-events: none;
    width: 90%;
}

/* Horizontal Text for Caption */
#caption-display {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--text-color);
    opacity: 0;
    transition: opacity 2s ease-in-out;
    text-shadow: 2px 2px 10px rgba(0,0,0,1), -1px -1px 8px rgba(0,0,0,0.8), 0px 0px 15px rgba(0,0,0,1);
    text-align: center;
    white-space: pre-wrap;
    line-height: 1.6;
}

#caption-display.show {
    opacity: 1;
}

.no-data {
    font-size: 1.2rem;
    color: #666;
    letter-spacing: 0.1em;
}

/* Admin Link slightly visible */
.admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.3s;
    font-family: sans-serif;
}
.admin-link:hover {
    color: var(--accent-color);
}

/* --- Admin Page Styles --- */
.admin-body {
    background-color: #121212;
    padding: 40px 20px;
}

.admin-header {
    text-align: center;
    margin-bottom: 40px;
}

.admin-header h1 {
    font-size: 2rem;
    color: var(--accent-color);
    letter-spacing: 0.1em;
    font-weight: 400;
}

.admin-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-size: 0.9rem;
}

.form-group input[type="file"],
.form-group input[type="text"],
.form-group input[type="url"] {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid var(--border-color);
    color: #fff;
    font-family: inherit;
    border-radius: 4px;
}

.form-group input[type="file"] {
    padding: 8px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn {
    display: inline-block;
    background: var(--accent-color);
    color: #000;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn-danger {
    background: #8b0000;
    color: #fff;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: normal;
}
.btn-danger:hover {
    background: #660000;
}

.message {
    margin-top: 15px;
    padding: 10px;
    display: none;
    border-radius: 4px;
}
.message.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
    display: block;
}
.message.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
    display: block;
}

/* List of uploaded items */
.item-list {
    margin-top: 50px;
}

.item-list h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-weight: 300;
}

.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.list-item {
    background: #222;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.list-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.list-item p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ddd;
}

#insta-display {
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: 1px solid var(--accent-color);
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-family: var(--font-japanese);
    letter-spacing: 0.1em;
    opacity: 0;
    transition: all 0.4s ease, opacity 2s ease-in-out;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    pointer-events: auto;
}

#insta-display svg {
    width: 20px;
    height: 20px;
}

#insta-display:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
    color: #fff;
    border-color: rgba(255,255,255,0.8);
}

#insta-display.show {
    opacity: 1;
}

/* --- Site Logo --- */
#site-logo {
    position: absolute;
    top: 45px;
    left: 55px;
    font-family: 'Cinzel', 'Noto Serif JP', serif;
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: rgba(253, 251, 247, 0.7);
    z-index: 100;
    opacity: 0;
    animation: fadeInSiteLogo 3.5s ease-out forwards 1.2s;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    text-shadow: 2px 2px 10px rgba(0,0,0,0.9);
    cursor: default;
}

/* --- Japanese Site Logo --- */
#ja-site-logo {
    position: absolute;
    top: 85px;
    left: 55px;
    font-family: var(--font-japanese);
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: rgba(253, 251, 247, 0.6);
    z-index: 100;
    opacity: 0;
    animation: fadeInSiteLogo 3.5s ease-out forwards 1.4s;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    text-shadow: 2px 2px 10px rgba(0,0,0,0.9);
    cursor: default;
}

/* --- Japanese Subtext (Under Logo) --- */
#ja-subtext {
    position: absolute;
    top: 110px;
    left: 55px;
    font-family: var(--font-japanese);
    font-size: 0.95rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: rgba(253, 251, 247, 0.5);
    z-index: 100;
    opacity: 0;
    animation: fadeInSiteLogo 3.5s ease-out forwards 1.5s;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    text-shadow: 2px 2px 10px rgba(0,0,0,0.9);
    cursor: default;
}

/* --- School Link --- */
#school-link {
    position: absolute;
    top: 45px;
    right: 55px;
    font-family: var(--font-japanese);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--text-color);
    text-decoration: none;
    z-index: 100;
    opacity: 0;
    animation: fadeInSiteLogo 3.5s ease-out forwards 1.6s;
    transition: all 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.5);
    padding: 10px 20px;
    border-radius: 4px;
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

#school-link:hover {
    color: #fff;
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.25);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

/* --- Scrolling Text --- */
#scrolling-text-container {
    position: absolute;
    top: 140px;
    left: 55px;
    width: 400px;
    overflow: hidden;
    white-space: nowrap;
    z-index: 100;
    opacity: 0;
    animation: fadeInSiteLogo 3.5s ease-out forwards 1.4s;
    display: none;
}

#scrolling-text {
    display: inline-block;
    font-size: 1.1rem;
    color: #ffffff;
    padding-left: 100%;
    animation: scrollText 15s linear infinite;
    font-family: var(--font-japanese), sans-serif;
    letter-spacing: 0.1em;
}

@keyframes scrollText {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

#site-logo:hover {
    transform: scale(1.02);
    color: rgba(253, 251, 247, 0.95);
    text-shadow: 0 0 15px rgba(212,175,55,0.6);
}

@keyframes fadeInSiteLogo {
    to { opacity: 0.8; }
}

/* --- Japanese Text Logo --- */
#ja-logo {
    position: absolute;
    bottom: 85px;
    left: 50px;
    font-family: var(--font-japanese);
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: rgba(253, 251, 247, 0.7);
    z-index: 100;
    opacity: 0;
    animation: fadeInLogo 3s ease-in-out forwards 1.3s;
    pointer-events: none;
    text-shadow: 1px 1px 10px rgba(0,0,0,0.8);
}

/* --- English Text Logo --- */
#en-logo {
    position: absolute;
    bottom: 55px;
    left: 50px;
    font-family: 'Cinzel', 'Noto Serif JP', serif;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.4em;
    color: rgba(253, 251, 247, 0.4);
    z-index: 100;
    opacity: 0;
    animation: fadeInLogo 3s ease-in-out forwards 1.5s;
    pointer-events: none;
    text-shadow: 1px 1px 10px rgba(0,0,0,0.8);
}

/* --- Copyright Display --- */
#copyright-display {
    position: absolute;
    bottom: 25px;
    left: 50px;
    font-family: 'Cinzel', 'Noto Serif JP', serif;
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: rgba(253, 251, 247, 0.4);
    z-index: 100;
    opacity: 0;
    animation: fadeInLogo 3s ease-in-out forwards 1.6s;
    pointer-events: none;
    text-shadow: 1px 1px 10px rgba(0,0,0,0.8);
}

/* --- Date Display --- */
#date-display {
    font-family: 'Cinzel', 'Noto Serif JP', serif;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    color: rgba(253, 251, 247, 0.9);
    opacity: 0;
    transition: opacity 2s ease-in-out;
    text-shadow: 1px 1px 10px rgba(0,0,0,0.9);
}

#date-display.show {
    opacity: 1;
}

@keyframes fadeInLogo {
    to { opacity: 0.95; }
}
/* --- Mobile Device Optimizations --- */
@media (max-width: 768px) {
    /* Main Display */
    #site-logo {
        top: 25px;
        left: 20px;
        font-size: 1.3rem;
    }

    #ja-site-logo {
        top: 55px;
        left: 20px;
        font-size: 1.0rem;
        letter-spacing: 0.2rem;
    }

    #ja-subtext {
        top: 75px;
        left: 20px;
        font-size: 0.8rem;
        letter-spacing: 0.15em;
    }

    #school-link {
        top: 25px;
        right: 20px;
        font-size: 1.0rem;
        padding: 6px 12px;
    }

    #scrolling-text-container {
        top: 100px;
        left: 20px;
        width: 300px;
    }

    #scrolling-text {
        font-size: 0.9rem;
    }

    #ja-logo {
        bottom: 65px;
        left: 20px;
        font-size: 1.3rem;
        letter-spacing: 0.2em;
    }

    #en-logo {
        bottom: 40px;
        left: 20px;
        font-size: 1.1rem;
        letter-spacing: 0.3em;
    }

    #copyright-display {
        bottom: 15px;
        left: 20px;
        font-size: 0.75rem;
        letter-spacing: 0.15em;
    }

    #date-display {
        font-size: 0.9rem;
    }
    
    #caption-display {
        font-size: 1.5rem;
    }

    #insta-display {
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    #insta-display svg {
        width: 16px;
        height: 16px;
    }

    /* Admin Panel */
    .admin-wrapper {
        padding: 20px 15px;
        margin: 10px;
    }

    .admin-header h1 {
        font-size: 1.6rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    .list-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .list-item {
        padding: 10px;
    }
    
    .list-item img {
        height: 120px;
    }
}

@media (max-width: 480px) {
    /* Smaller iPhones, etc */
    #caption-display {
        font-size: 1.2rem;
        letter-spacing: 0.1em;
        line-height: 1.6;
    }
    
    .admin-header h1 {
        font-size: 1.3rem;
    }
    
    .list-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
}

/* Landscape Mode for Smartphones (prevent overlapping in short viewports) */
@media (max-height: 500px) and (orientation: landscape) {
    #site-logo { top: 10px; left: 20px; font-size: 1rem; }
    #ja-site-logo { top: 30px; left: 20px; font-size: 0.85rem; }
    #ja-subtext { top: 45px; left: 20px; font-size: 0.7rem; }
    #school-link { top: 10px; right: 20px; font-size: 0.85rem; padding: 4px 10px; }
    #scrolling-text-container { top: 60px; left: 20px; width: 250px; }
    #scrolling-text { font-size: 0.75rem; }

    #ja-logo { bottom: 40px; left: 20px; font-size: 1.1rem; }
    #en-logo { bottom: 22px; left: 20px; font-size: 0.9rem; }
    #copyright-display { bottom: 8px; left: 20px; font-size: 0.65rem; }

    #info-container { gap: 6px; }
    #caption-display { font-size: 1.1rem; line-height: 1.4; }
    #date-display { font-size: 0.8rem; }
    #insta-display { font-size: 0.8rem; padding: 4px 12px; }
}
