/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap'); /* Added JP font */

:root {
    /* Colors - Caribbean & Colonial Palette */
    --primary: #00A896;      /* Persian Green */
    --primary-dark: #007f70;
    --accent: #F4A261;       /* Sandy Brown */
    --text-main: #2D3142;
    --text-light: #585F75;
    --bg-body: #F0F4F8;
    --bg-card: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    
    /* Spacing */
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(39, 40, 50, 0.1);
    --blur-strength: 12px;
    
    /* Radii */
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif; /* Added JP font */
    background-color: var(--bg-body);
    /* Subtle background pattern could go here */
    background-image: 
        radial-gradient(at 0% 0%, rgba(0, 168, 150, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(244, 162, 97, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 80px; /* Space for footer/bottom nav */
}

/* Utilities */
.container {
    max-width: 600px; /* Mobile focused max width */
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--space-md) 0;
    margin-bottom: var(--space-xl);
    transition: all var(--transition-fast);
}

header.scrolled {
    padding: var(--space-sm) 0;
    background: rgba(240, 244, 248, 0.85); /* Matches body bg but glassy */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--text-light);
    font-weight: 700;
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    background: rgba(0,0,0,0.05);
    border-radius: 50px;
    padding: 4px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.lang-btn {
    border: none;
    background: none;
    padding: 6px 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    z-index: 2;
    transition: color var(--transition-fast);
    cursor: pointer;
    min-width: 80px; /* Ensure wide enough for Nihongo and equal width */
    text-align: center;
    flex: 1;
}

.lang-btn.active {
    color: var(--text-main);
}

.lang-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 50%; /* Approx, js handles exact sizing if needed, or flex handles simple cases */
    bottom: 4px;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform var(--transition-fast);
    z-index: 1;
    /* We'll use a class to move this */
    width: calc(50% - 4px);
}

/* JP active state */
.lang-toggle.jp-mode .lang-slider {
    transform: translateX(100%);
}

/* Location List */
.tour-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Location Card */
.location-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.location-card:active {
    transform: scale(0.99);
}

.card-header {
    padding: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* New header layout for bilingual titles */
.header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-info h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
    line-height: 1.2;
}

.header-index {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 168, 150, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

/* Japanese Name Subtitle */
.header-jp-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
    margin-left: 2px;
}

.header-jp-kana {
    font-size: 0.9rem; /* Increased from 0.7rem */
    color: var(--text-light);
    line-height: 1.3;
    opacity: 0.9;
    word-spacing: 0.1em; /* Extra spacing between words */
}

.header-jp-kanji {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.2;
}

/* Category Tag */
.category-tag {
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.03);
    padding: 6px 10px; /* Slightly more padding */
    border-radius: 8px;
    /* align-items: center; */
}

/* Specific styling for JP category */
.category-kana {
    font-size: 0.8rem; /* Increased from 0.65rem */
    color: var(--text-light);
    line-height: 1.2;
    margin-bottom: 2px;
    word-spacing: 0.1em;
}

.category-text {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.2;
}

.expand-icon {
    color: var(--primary);
    transition: transform var(--transition-smooth);
    min-width: 24px; /* Prevent shrink */
    margin-left: 12px;
}

/* Expanded State */
.location-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.location-card.expanded {
    box-shadow: var(--shadow-glass);
}

.card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-smooth);
    background: rgba(255,255,255,0.4);
}

.card-content {
    padding: 0 var(--space-md) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.info-block {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
}

.info-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 4px;
}

/* Content Text Styling */
.info-text-container {
    display: flex;
    flex-direction: column;
}

.info-kana {
    font-size: 1.05rem; /* Increased from 0.85rem - Primary reading text */
    color: var(--primary-dark);
    margin-bottom: 4px; /* More separation from Kanji */
    line-height: 1.6;
    display: none; /* Hidden by default for ES */
    word-spacing: 0.15em; /* Clearer word boundaries */
    font-weight: 400; /* Ensure it's legible */
}

.info-main {
    font-size: 1.1rem; /* Large readable text */
    font-weight: 400;
    color: var(--text-main);
    line-height: 1.5;
}

/* Show kana when playing JP */
body.jp-active .info-kana {
    display: block;
}

/* Footer post-tour */
.post-tour {
    margin-top: var(--space-xl);
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}

.post-tour p {
    color: var(--text-light);
    margin-bottom: var(--space-md);
}

.cta-button {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 168, 150, 0.3);
    transition: transform var(--transition-fast);
}

.cta-button:active {
    transform: translateY(2px);
}
