/* =============================================
   Fukuoka Discovery - Light Theme Styles
   ============================================= */

/* CSS Variables */
:root {
    /* Colors */
    --primary: #00B894;
    --primary-light: #55E6C1;
    --primary-dark: #00997A;
    --secondary: #FFC312;
    --background: #FFFFFF;
    --background-secondary: #F8F9FA;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-muted: #B2BEC3;
    --border: #E9ECEF;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);

    /* Category Colors */
    --cat-gourmet: #FF6B6B;
    --cat-history: #FECA57;
    --cat-shopping: #5F27CD;
    --cat-nature: #00B894;
    --cat-ramen: #FF9F43;
    --cat-yatai: #EE5A5A;
    --cat-cafe: #C44569;
    --cat-sightseeing: #10AC84;

    /* Spacing */
    --header-height: 60px;
    --bottom-nav-height: 70px;
    --content-padding: 16px;
    --card-radius: 16px;
    --btn-radius: 12px;
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: var(--bottom-nav-height);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--content-padding);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.menu-btn,
.notification-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.menu-btn:hover,
.notification-btn:hover {
    background: var(--background-secondary);
}

/* Main Content */
.main-content {
    padding-top: calc(var(--header-height) + 16px);
    padding-left: var(--content-padding);
    padding-right: var(--content-padding);
    padding-bottom: 20px;
}

/* Search Bar */
.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--background-secondary);
    border-radius: 50px;
    border: 1px solid var(--border);
}

.search-bar i {
    color: var(--text-muted);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.filter-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    background: var(--background);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--background-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

/* Location Card */
.location-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--card-radius);
    color: white;
    margin-bottom: 24px;
}

.location-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.location-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.location-desc {
    font-size: 0.85rem;
    opacity: 0.9;
}

.weather-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.weather-info i {
    font-size: 2rem;
    color: var(--secondary);
}

.temperature {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Section Styles */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.see-all {
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* Category Grid */
.category-section {
    margin-bottom: 28px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.category-item:hover {
    transform: translateY(-2px);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.category-icon.gourmet {
    background: rgba(255, 107, 107, 0.15);
    color: var(--cat-gourmet);
}

.category-icon.history {
    background: rgba(254, 202, 87, 0.15);
    color: var(--cat-history);
}

.category-icon.shopping {
    background: rgba(95, 39, 205, 0.15);
    color: var(--cat-shopping);
}

.category-icon.nature {
    background: rgba(0, 184, 148, 0.15);
    color: var(--cat-nature);
}

.category-icon.ramen {
    background: rgba(255, 159, 67, 0.15);
    color: var(--cat-ramen);
}

.category-icon.yatai {
    background: rgba(238, 90, 90, 0.15);
    color: var(--cat-yatai);
}

.category-icon.cafe {
    background: rgba(196, 69, 105, 0.15);
    color: var(--cat-cafe);
}

.category-icon.sightseeing {
    background: rgba(16, 172, 132, 0.15);
    color: var(--cat-sightseeing);
}

.category-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Events Section */
.events-section {
    margin-bottom: 28px;
}

.events-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.events-scroll::-webkit-scrollbar {
    display: none;
}

.event-card {
    flex-shrink: 0;
    width: 200px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.2s;
}

.event-card:hover {
    transform: translateY(-4px);
}

.event-image {
    position: relative;
    height: 140px;
    border-radius: var(--card-radius);
    overflow: hidden;
    margin-bottom: 10px;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-date {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: white;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
}

.event-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.event-location i {
    font-size: 0.7rem;
}

/* Nearby Section */
.nearby-section {
    margin-bottom: 20px;
}

.spots-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.spot-card {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.spot-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.spot-card .spot-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.spot-card .spot-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spot-card .spot-info {
    flex: 1;
    min-width: 0;
}

.spot-card .spot-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spot-card .spot-category {
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.spot-card .spot-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.spot-card .spot-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--secondary);
    margin-top: 4px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--background);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover:not(.active) {
    color: var(--text-secondary);
}

/* Pages */
.page {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--background);
    z-index: 200;
    padding-bottom: var(--bottom-nav-height);
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.page-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--background-secondary);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

#map {
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height) - 60px);
}

/* Saved Page */
.saved-content {
    padding: var(--content-padding);
    overflow-y: auto;
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height) - 60px);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state .fa-heart {
    font-size: 3rem;
    color: var(--text-muted);
}

.empty-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Profile Page */
.profile-content {
    padding: var(--content-padding);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height) - 60px);
}

.profile-card {
    text-align: center;
    padding: 28px 16px;
    background: var(--background-secondary);
    border-radius: var(--card-radius);
}

.profile-avatar {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-stats {
    display: flex;
    gap: 12px;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 8px;
    background: var(--background-secondary);
    border-radius: var(--card-radius);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-section {
    background: var(--background-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
}

.profile-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.profile-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--background);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    z-index: 1;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    height: 220px;
    background: var(--background-secondary);
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-body {
    padding: 20px;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.modal-tag {
    padding: 4px 12px;
    background: rgba(0, 184, 148, 0.1);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--primary);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--background-secondary);
    border-radius: var(--btn-radius);
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-item i {
    color: var(--primary);
    width: 18px;
}

.modal-reviews h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-reviews h3 i {
    color: var(--primary);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.review-item {
    padding: 14px;
    background: var(--background-secondary);
    border-radius: var(--btn-radius);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.review-user {
    font-weight: 500;
    font-size: 0.9rem;
}

.review-rating {
    color: var(--secondary);
    font-size: 0.85rem;
}

.review-title {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.review-comment {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-secondary {
    background: var(--background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary i.fa-google {
    color: #4285F4;
}

#modalGoogleMapsBtn {
    grid-column: span 2;
    background: #fff;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary.favorited {
    background: rgba(255, 107, 107, 0.1);
    border-color: #FF6B6B;
    color: #FF6B6B;
}

/* Leaflet Marker Fix */
.leaflet-marker-icon {
    max-width: none !important;
    max-height: none !important;
}

/* Responsive */
@media (min-width: 768px) {
    .main-content {
        max-width: 600px;
        margin: 0 auto;
    }

    .category-grid {
        grid-template-columns: repeat(8, 1fr);
    }

    .event-card {
        width: 240px;
    }

    .spot-card .spot-image {
        width: 100px;
        height: 100px;
    }

    .modal-content {
        max-width: 500px;
        border-radius: 24px;
        margin-bottom: 20px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
/* =============================================
   Affiliate Links
   ============================================= */
.affiliate-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.affiliate-section h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.affiliate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--btn-radius);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 8px;
    transition: opacity 0.15s, transform 0.15s;
}

.affiliate-btn:last-child {
    margin-bottom: 0;
}

.affiliate-btn:active {
    opacity: 0.75;
    transform: scale(0.98);
}

.affiliate-btn.rakuten {
    background: #BF0000;
    color: #fff;
}


/* =============================================
   Google Places 動的情報
   ============================================= */

.places-info-section {
    margin-bottom: 16px;
}

.places-loading {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.places-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: places-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes places-spin {
    to { transform: rotate(360deg); }
}

.places-dynamic-info {
    background: var(--background-secondary);
    border-radius: var(--btn-radius);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.places-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.places-rating i.fa-star,
.places-rating i.fa-star-half-alt {
    color: var(--secondary);
    font-size: 0.8rem;
}

.places-rating i.far.fa-star {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.places-review-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

.places-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.places-open {
    color: #00B894;
    font-weight: 600;
}

.places-closed {
    color: #FF6B6B;
    font-weight: 600;
}

.places-hours-today {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.places-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.places-phone,
.places-website {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.places-phone:hover,
.places-website:hover {
    text-decoration: underline;
}

.places-phone i,
.places-website i {
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}
