/* ===== リセット & ベーススタイル ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --dark-bg: #1a1a2e;
    --light-bg: #f8f9fa;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --border-color: #dfe6e9;
    --success-color: #00b894;
    --danger-color: #d63031;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* ===== 認証画面 ===== */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
}

.auth-logo {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.auth-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: var(--text-dark);
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* ===== ボタン ===== */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), #e74c3c);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

/* ===== メインアプリ ===== */
#mainApp {
    position: relative;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* ===== スクリーン管理 ===== */
.screen {
    display: none;
    position: relative;
    min-height: calc(100vh - 70px);
}

.screen.active {
    display: block;
}

/* ===== ストーリーズバー ===== */
.stories-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 15px 10px;
    overflow-x: auto;
    z-index: 100;
    box-shadow: var(--shadow);
}

.stories-container {
    display: flex;
    gap: 15px;
    padding: 0 10px;
}

.story-item {
    flex-shrink: 0;
    text-align: center;
    cursor: pointer;
}

.story-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    padding: 3px;
    background: white;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.story-username {
    font-size: 12px;
    margin-top: 5px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== リールフィード（TikTok風） ===== */
#reelsScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: black;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

#reelsScreen::-webkit-scrollbar {
    display: none;
}

.reel-item {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.reel-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reel-overlay {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    z-index: 10;
}

.reel-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.reel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

.reel-username {
    font-weight: 600;
    font-size: 16px;
}

.reel-caption {
    margin-bottom: 10px;
    line-height: 1.4;
}

.reel-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    opacity: 0.9;
}

.reel-actions {
    position: absolute;
    right: 15px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    z-index: 20;
}

.reel-action {
    text-align: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.reel-action:active {
    transform: scale(0.9);
}

.action-icon {
    font-size: 28px;
    margin-bottom: 5px;
}

.action-count {
    font-size: 12px;
}

.reel-book-btn {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    z-index: 15;
    box-shadow: 0 5px 15px rgba(255,107,107,0.4);
}

/* ===== 検索・予約画面 ===== */
#searchScreen {
    padding-top: 60px;
}

.search-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    background: white;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    z-index: 100;
}

.search-header h2 {
    font-size: 20px;
}

.search-tabs {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    position: sticky;
    top: 60px;
    z-index: 99;
}

.search-tabs::-webkit-scrollbar {
    display: none;
}

.search-tab {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.search-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.search-content {
    display: none;
    padding: 20px;
}

.search-content.active {
    display: block;
}

.search-form {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.search-results {
    display: grid;
    gap: 15px;
}

.result-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.result-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.result-info {
    padding: 15px;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.result-details {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 10px;
}

.result-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.result-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-color);
    font-weight: 600;
}

/* ===== 乗換案内結果 ===== */
.route-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 15px;
}

.route-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.route-time {
    font-size: 18px;
    font-weight: 600;
}

.route-duration {
    color: var(--text-light);
}

.route-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.route-step {
    display: flex;
    gap: 15px;
    padding: 10px;
    background: var(--light-bg);
    border-radius: 8px;
}

.step-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
}

.step-info {
    flex: 1;
}

.step-transport {
    font-weight: 600;
    margin-bottom: 3px;
}

.step-time {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== マップ画面 ===== */
#mapScreen {
    position: relative;
}

#map {
    width: 100%;
    height: calc(100vh - 70px);
}

.map-filters {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    padding: 10px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.filter-btn {
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.marker-popup {
    text-align: center;
}

.marker-popup img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.marker-popup h4 {
    margin-bottom: 5px;
}

.marker-popup .btn-primary {
    margin-top: 10px;
}

/* ===== フィード画面 ===== */
.feed-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 15px 20px;
    box-shadow: var(--shadow);
    z-index: 100;
}

.feed-header h2 {
    font-size: 24px;
}

.feed-container {
    padding: 20px 0;
}

.feed-post {
    background: white;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

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

.post-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.post-location {
    font-size: 12px;
    color: var(--text-light);
}

.post-media {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.post-actions {
    padding: 10px 15px;
    display: flex;
    gap: 15px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dark);
    transition: color 0.2s;
}

.action-btn.liked {
    color: var(--primary-color);
}

.post-caption {
    padding: 0 15px 15px;
}

.post-caption strong {
    margin-right: 5px;
}

.post-comments {
    padding: 0 15px 15px;
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
}

/* ===== プロフィール画面 ===== */
.profile-header {
    background: white;
    margin-bottom: 10px;
}

.profile-cover {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.profile-info {
    padding: 20px;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 5px solid white;
    margin-top: -70px;
    object-fit: cover;
}

.profile-info h2 {
    margin: 15px 0 5px;
    font-size: 24px;
}

.profile-info p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
}

.profile-menu {
    background: white;
    padding: 10px 0;
    margin-bottom: 10px;
}

.menu-item {
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:hover {
    background: var(--light-bg);
}

.menu-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.menu-item.danger {
    color: var(--danger-color);
}

.menu-item.danger i {
    color: var(--danger-color);
}

.profile-content {
    background: white;
    padding: 20px;
    min-height: 300px;
}

/* ===== ツアーカテゴリ ===== */
.tour-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding: 10px 0;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.category-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* ===== モーダル ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 24px;
}

.booking-total {
    margin: 20px 0;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 10px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.total-row.total {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    padding-top: 10px;
    border-top: 2px solid var(--border-color);
}

/* ===== フローティングアクションボタン ===== */
.fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #e74c3c);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255,107,107,0.5);
    z-index: 1000;
    transition: transform 0.2s;
}

.fab:hover {
    transform: scale(1.1);
}

/* ===== ボトムナビゲーション ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 10px 0;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 22px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

/* ===== フッター ===== */
.app-footer {
    background: var(--dark-bg);
    color: white;
    padding: 40px 20px 100px;
    text-align: center;
}

.app-footer p {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.copyright {
    font-size: 12px;
    opacity: 0.7;
}

/* ===== レスポンシブ ===== */
@media (min-width: 768px) {
    .search-results {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reel-item {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .search-results {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== ユーティリティ ===== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}
