
/* ========================================
   Base
======================================== */

:root {
    /* Font Family */
    --font-primary: "Outfit", "Noto Sans JP", sans-serif;

    /* Font Weight */
    --font-regular: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f4f5f8;
    font-family: var(--font-primary);
    color: #222;
    font-weight: var(--font-regular);
    line-height: 1.6;
}

/* フォーム・ボタンも共通フォントに統一 */
button,
input,
textarea,
select {
    font-family: inherit;
}


/* ========================================
   Header
======================================== */

header {
    background: white;
    padding: 18px;
    text-align: center;
    font-weight: bold;
    font-size: 20px;
    position: sticky;
    top: 0;
    border-bottom: 1px solid #eee;
    z-index: 100;
}

.header {
    position: relative;
    height: 80px;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.menu-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    cursor: pointer;
}


/* ========================================
   Layout
======================================== */

.container {
    max-width: 420px;
    margin: auto;
    padding: 16px;
}

#list {
    position: relative;
}

#list::before,
#list::after {
    display: none !important;
}


/* ========================================
   Card
======================================== */

.card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin: 12px;
}

.card h2 {
    font-size: 18px;
    margin-bottom: 14px;
}


/* ========================================
   Form
======================================== */

input,
textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 14px;
    margin-top: 8px;
    margin-bottom: 14px;
    font-size: 16px;
    background: white;
}

input[type="date"],
input[type="datetime-local"] {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
}

input[type="datetime-local"] {
    padding: 10px 12px;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #5b5be0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.label-icon {
    width: 16px;
    height: 16px;
}

.file-input {
    width: 100%;
}


/* ========================================
   Location
======================================== */

.location {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px;
    margin-top: 10px;
    margin-bottom: 16px;
}

.location p {
    margin-bottom: 6px;
}

.location-row,
.location-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.location-row2 {
    margin-top: 5px;
    padding: 8px 10px;
    font-size: 18px;
    color: #555;
}

.location-info {
    flex: 1;
}

.location-info2 p {
    margin: 2px 0;
    text-align: center;
}


/* ========================================
   Buttons
======================================== */

.location-button,
.save-button,
.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    height: 52px;

    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 12px;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.location-button:hover,
.save-button:hover,
.action-button:hover {
    background: #284b78;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 95, 0.35);
}

.location-button:active,
.save-button:active,
.action-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}

.action-button {
    margin-top: 12px;
    padding: 12px;
    font-size: 14px;
}

.button-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.nav-button {
    min-width: 120px;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: #1e3a5f;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.nav-button:hover {
    background: #284b78;
}

.delete-button {
    background: #c0392b;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.25);
}

.delete-button:hover {
    background: #e74c3c;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.management-buttons {
    display: flex;
    gap: 12px;
}

.action-buttons.management-buttons {
    flex-direction: row;
    gap: 12px;
}

.management-buttons .action-button {
    width: auto;
    flex: 1;
}


/* ========================================
   Side Menu
======================================== */

.side-menu {
    position: fixed;
    left: -260px;
    top: 0;
    width: 200px;
    height: 100%;
    background: white;
    transition: 0.3s;
    z-index: 1000;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.1);
}

.side-menu.open {
    left: 0;
}

.menu-header {
    padding: 24px 20px;
    background: #1e3a5f;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.side-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    transition: 0.2s;
}

.side-menu a:hover {
    background: #f4f5f8;
}


/* ========================================
   GPS
======================================== */

.gps-card {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.gps-item {
    text-align: center;
    flex: 1;
}

.gps-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gps-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e3a5f;
}

.gps-divider {
    width: 1px;
    height: 40px;
    background: #e5e7eb;
}


/* ========================================
   Tags
======================================== */

.tag-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tag-input-row input {
    flex: 1;
}

#tagContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    font-size: 11px;
    background: #1e3a5f;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;

    cursor: default;
    pointer-events: auto;
}

.tag-remove {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
    pointer-events: auto;
}

.tag-remove:hover {
    color: #ff5252;
}

.tag-add {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: #1e3a5f;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(30, 58, 95, 0.25);
}

.tag-add:hover {
    background: #284b78;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(30, 58, 95, 0.35);
}

.tag-add:active {
    transform: translateY(0);
}

.tags,
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
}


/* ========================================
   Timeline
======================================== */

.timeline-item {
    padding-left: 0;
    margin-bottom: 0;
}

.timeline-card {
    background: white;
    border-radius: 14px;
    padding: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.timeline-time {
    color: #999;
    font-size: 12px;
    margin-bottom: 6px;
}

.timeline-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 6px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.timeline-memo {
    color: #666;
    line-height: 1.5;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;

    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.item-tag {
    background: #eef2ff;
    color: #4f46e5;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}


.timeline-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 12px;
}



/* ========================================
   Item List
======================================== */

.item {
    display: flex;
    gap: 12px;
    background: #fafafa;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}

.thumb {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item-content h3 {
    margin-bottom: 6px;
    font-size: 16px;
}

.item-content p {
    color: #666;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-content small {
    color: #999;
}


/* ========================================
   Detail
======================================== */

.detail-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 12px;
}

.thumbnail-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.thumbnail-image {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.thumbnail-image:hover {
    border-color: #4f46e5;
}



/* ========================================
   SNS Card
======================================== */

.sns-card {
    width: 1080px;
    height: 1350px;

    position: fixed;
    left: -99999px;
    top: 0;

    background: #fff;
    overflow: hidden;

    display: block;

    border: 30px solid #284b78;
    border-radius: 0;
}

/* SNS Card Inner */

.sns-inner {
    width: 100%;
    height: 100%;

    padding: 24px 36px;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    gap: 12px;

    min-width: 0;
    overflow: hidden;
}


/* ========================================
   SNS Header
======================================== */

.sns-footer {
    flex: 0 0 100px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    margin: 0;
    padding: 5px 0;

    border-top: 1px solid #eee;
}

.sns-catch {
    display: flex;
    justify-content: center;
    align-items: center;

    margin: 0;
    padding: 0;
}

.sns-logo {
    display: block;

    width: 200px;
    height: 50px;

    max-width: 100%;

    object-fit: contain;
}

.sns-subcatch {
    font-size: 20px;
    font-weight: 400;

    color: #777;

    margin: 4px 0 0;

    letter-spacing: 0.5px;
}


/* ========================================
   SNS Location
======================================== */

.location-row2 {
    flex: 0 0 40px;

    display: flex;
    justify-content: center;
    align-items: center;

    margin: 0;
    padding: 0;

    font-size: 16px;
    color: #555;
}

.location-info2 {
    width: 100%;
}

.location-info2 p {
    margin: 0;
    text-align: center;
    font-size: 16px;
}


/* ========================================
   SNS QR Code
======================================== */

.qr-row {
    flex: 0 0 150px;

    display: flex;
    justify-content: center;
    align-items: center;

    margin: 0;
}

.qr-image {
    width: 140px;
    height: 140px;

    max-width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-image img {
    display: block;

    width: 130px;
    height: 130px;

    object-fit: contain;
}


/* ========================================
   SNS Text Area
======================================== */

.sns-text-area {
    flex: 0 0 220px;

    width: 100%;
    height: 220px;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    padding: 8px 0;
}


/* Title */

.sns-title {
    flex: 0 0 auto;

    font-size: 30px;
    line-height: 1.4;

    font-weight: 700;
    color: #1e3a5f;

    background: transparent;

    padding: 0;
    margin: 0 0 6px;

    letter-spacing: 0;

    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


/* Date */

.sns-date {
    flex: 0 0 auto;

    font-size: 16px;
    line-height: 1.5;

    color: #888;

    margin: 0 0 8px;
}


/* Memo */

.sns-memo {
    flex: 1 1 auto;

    min-height: 0;

    font-size: 20px;
    line-height: 1.6;

    color: #333;

    margin: 0;
    padding: 0;

    text-align: left;
    text-indent: 0;

    overflow: hidden;

    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;

    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}


/* ========================================
   SNS Photo Area
======================================== */

.sns-photo-area {
    flex: 0 0 500px;

    width: 100%;
    height: 500px;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;

    background: #f8fafc;

    border-radius: 12px;
}


/* Photo */

.sns-image {
    display: block;

    width: 100%;
    height: 100%;

    max-width: 100%;
    max-height: 100%;

    flex: none;

    padding: 0;
    margin: 0;

    object-fit: contain;
    object-position: center;

    border-radius: 12px;
}


/* ========================================
   QR Code
======================================== */

.qr-row {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

.qr-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 180px;
    max-width: 100%;
    height: 180px;
}

.qr-image img {
    width: 160px;
    height: 160px;
    display: block;
}

.qr-section {
    margin-top: 24px;
    text-align: center;
}


/* ========================================
   Image Preview
======================================== */

/* プレビュー画像のコンテナ */
.preview-item {
    position: relative;
    display: inline-block;
    margin: 6px;
}

/* プレビュー画像 */
.preview-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0;
}

/* 画像削除ボタン */
.preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* インポート画像プレビュー */
.import-preview img {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 12px;
    margin-top: 12px;
}

/* ========================================
   Card List
======================================== */

#cardList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
    padding: 30px;
}

.card-item {
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: 0.2s;
    padding-bottom: 30px;
}

.card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
}

.card-item p {
    font-size: 12px;
    padding: 6px 8px;
    margin: 0;
    color: #666;
}


/* ========================================
   Card Detail
======================================== */

.card-detail {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
}

.card-detail-image {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.card-tags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-date {
    margin-top: 10px;
    color: #777;
    font-size: 14px;
}


/* ========================================
   Settings
======================================== */

.setting-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: bold;
}

.setting-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.setting-divider {
    height: 1px;
    background: #eee;
    margin: 24px 0;
}

/* ========================================
   Language Select
======================================== */

#languageSelect {
    width: 100%;
    height: 52px;

    padding: 0 14px;

    border: 1px solid #ddd;
    border-radius: 12px;

    background: #fff;
    color: #333;

    font-family: inherit;
    font-size: 16px;

    cursor: pointer;
    appearance: auto;
}

#languageSelect:focus {
    outline: none;
    border-color: #5b5be0;
}


/* ========================================
   Links
======================================== */

.open-link {
    display: block;
    margin-top: 20px;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    background: #1e3a5f;
    color: #fff;
    text-decoration: none;
}



/* ==============================
   Tapnavi
============================== */

.tapnavi-main {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 35px 20px 60px;
}

.tapnavi-section {
    width: 100%;
}

/* Heading */

.tapnavi-heading {
    text-align: center;
    margin-bottom: 35px;
}

.tapnavi-heading h1 {
    font-size: 36px;
    font-weight: var(--font-bold);
    letter-spacing: 1px;
    color: #222;
    margin: 0 0 8px;
}

.tapnavi-heading p {
    font-size: 14px;
    font-weight: var(--font-regular);
    letter-spacing: 0.3px;
    color: #888;
    margin: 0;
}

/* Category Grid */

.tapnavi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.tapnavi-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 115px;
    padding: 15px 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    color: #333;
    font-size: 14px;
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tapnavi-button:hover {
    background: #f0faff;
    border-color: #42b9dc;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.tapnavi-button:active {
    transform: scale(0.97);
}

.tapnavi-icon {
    font-size: 32px;
    line-height: 1;
}

/* Guide */

.tapnavi-guide {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background: #f3f8fb;
    border-radius: 12px;
}

.tapnavi-guide-icon {
    font-size: 25px;
}

.tapnavi-guide strong {
    display: block;
    font-size: 15px;
    font-weight: var(--font-semibold);
    margin-bottom: 7px;
}

.tapnavi-guide p {
    font-size: 13px;
    line-height: 1.8;
    color: #666;
    margin: 0;
}

/* Tablet */

@media (max-width: 600px) {

    .tapnavi-main {
        padding: 25px 15px 40px;
    }

    .tapnavi-heading {
        margin-bottom: 28px;
    }

    .tapnavi-heading h1 {
        font-size: 28px;
    }

    .tapnavi-heading p {
        font-size: 13px;
    }

    .tapnavi-grid {
        gap: 10px;
    }

    .tapnavi-button {
        min-height: 105px;
        font-size: 13px;
        border-radius: 12px;
    }

    .tapnavi-icon {
        font-size: 29px;
    }
}

/* Small smartphone */

@media (max-width: 360px) {

    .tapnavi-grid {
        gap: 8px;
    }

    .tapnavi-button {
        min-height: 95px;
        padding: 10px 5px;
        font-size: 12px;
    }

    .tapnavi-icon {
        font-size: 26px;
    }
}


/* ==============================
   Tapnavi Heading
============================== */

.tapnavi-heading {
    text-align: center;
    margin-bottom: 35px;
}

.tapnavi-heading h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #222;
    margin: 0 0 8px;
}

.tapnavi-heading p {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: #888;
    margin: 0;
}

@media (max-width: 600px) {
    .tapnavi-heading {
        margin-bottom: 28px;
    }

    .tapnavi-heading h1 {
        font-size: 28px;
    }

    .tapnavi-heading p {
        font-size: 13px;
    }
}

/* Footer */

        .about-page .about-footer {
            text-align: center;
            padding: 28px 10px 10px;
            font-size: 12px;
            opacity: 0.6;
            line-height: 1.9;
        }

        .about-page .about-footer strong {
            font-size: 16px;
            letter-spacing: 1px;
        }



#preview {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    max-width: 100%;
    overflow: hidden;
}

#preview img {
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* ========================================
   Image Preview Modal
======================================== */

.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;

    background: rgba(0, 0, 0, 0.92);

    justify-content: center;
    align-items: center;

    padding: 20px;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    max-width: 100%;
    max-height: 90vh;

    object-fit: contain;

    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;

    color: white;
    font-size: 40px;
    font-weight: bold;

    cursor: pointer;
    z-index: 10000;
}

/* Card image interaction */

.card-detail-image {
    cursor: zoom-in;
}