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

body {
    font-family: 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
}

/* ログイン画面 */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    text-align: center;
}

.logo-section {
    margin-bottom: 60px;
}

.logo {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #4a90e2;
}

.tagline {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    border: 2px solid #dadce0;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 240px;
}

.google-login-btn:hover {
    box-shadow: 0 1px 2px 0 rgba(60,64,67,.30), 0 1px 3px 1px rgba(60,64,67,.15);
    background: #f8f9fa;
}

.google-login-btn:active {
    background: #f1f3f4;
}

.login-buttons {
    width: 100%;
    max-width: 280px;
}

/* ヘッダー */
header {
    background: #4a90e2;
    color: white;
    padding: 15px 20px;
}

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

.header-content .logo {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ナビゲーション */
.nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab.active {
    background: white;
    color: #4a90e2;
    border-bottom: 2px solid #4a90e2;
}

/* タブコンテンツ */
.tab-content {
    display: none;
}

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

.content {
    padding: 20px;
}

/* マップ */
.map-container {
    height: 300px;
    background: #e9ecef;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    z-index: 1;
}

.map-loading.hidden {
    display: none;
}

.map-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    z-index: 2;
}

.placeholder-content {
    text-align: center;
    padding: 30px;
    max-width: 300px;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.placeholder-content h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 20px;
}

.placeholder-content p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 14px;
}

.placeholder-features {
    margin-bottom: 20px;
}

.feature-item {
    margin: 8px 0;
    font-size: 13px;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.placeholder-content small {
    color: #868e96;
    font-style: italic;
}

/* 無料マップ（Leaflet + OpenStreetMap） */
.map-container {
    position: relative;
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.map {
    width: 100%;
    height: 300px;
    border-radius: 15px;
}

.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.map-control-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.map-control-btn:hover {
    background: rgba(74, 144, 226, 0.95);
    color: white;
    transform: translateY(-1px);
}

/* アクションボタンセクション（マップ上部） */
.action-buttons-section {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.action-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 散歩開始ボタン */
.action-btn.walk-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.action-btn.walk-btn:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* チェックインボタン */
.action-btn.check-in-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
}

.action-btn.check-in-btn:hover {
    background: linear-gradient(135deg, #357abd, #2c5aa0);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

/* チェックアウトボタン */
.action-btn.check-out-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.action-btn.check-out-btn:hover {
    background: linear-gradient(135deg, #c82333, #a02622);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* 散歩中統計セクション */
.walk-stats-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 2px solid #28a745;
}

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

.walk-stats-header h4 {
    margin: 0;
    color: #28a745;
    font-size: 18px;
    font-weight: bold;
}

.walk-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #28a745;
    font-size: 14px;
    font-weight: bold;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.walk-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.walk-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.walk-control-btn {
    flex: 1;
    max-width: 150px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.walk-control-btn.pause-btn {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.walk-control-btn.pause-btn:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    transform: translateY(-1px);
}

.walk-control-btn.stop-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.walk-control-btn.stop-btn:hover {
    background: linear-gradient(135deg, #c82333, #a02622);
    transform: translateY(-1px);
}

.walk-control-btn.resume-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.walk-control-btn.resume-btn:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: translateY(-1px);
}

.map-toggle-hidden .map-container {
    height: 60px;
    transition: height 0.3s ease;
}

.map-toggle-hidden .map {
    height: 60px;
}

.map-toggle-hidden .location-matching {
    margin-top: 0;
}

/* カスタムマーカースタイル */
.custom-marker, .park-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #4a90e2;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.park-marker {
    border-color: #28a745;
}

/* 公園ポップアップスタイル */
.park-popup {
    text-align: center;
    padding: 5px;
}

.park-popup h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 14px;
}

.park-popup p {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #666;
}

.park-select-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.park-select-btn:hover {
    background: #357abd;
}

/* ロケーションマッチング機能 */
.location-matching {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.location-header h3 {
    margin: 0;
    color: #495057;
    font-size: 18px;
}

.location-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

#location-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    min-width: 150px;
}

.refresh-btn {
    padding: 8px 12px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #357abd;
    transform: rotate(180deg);
}

/* 現在地ステータス */
.current-location-status {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #4a90e2;
}

.status-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-icon {
    width: 30px;
    font-size: 16px;
}

.status-text {
    color: #495057;
}

/* ロケーションタブ */
.location-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 12px;
}

.location-tab {
    flex: 1;
    padding: 10px 5px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #6c757d;
    transition: all 0.3s ease;
    text-align: center;
}

.location-tab.active {
    background: #4a90e2;
    color: white;
    box-shadow: 0 2px 5px rgba(74, 144, 226, 0.3);
}

.location-tab:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

/* ロケーションの人々 */
.location-people {
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.person-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.person-item:hover {
    background: #e9ecef;
    border-left-color: #4a90e2;
    transform: translateX(3px);
}

.person-item:last-child {
    margin-bottom: 0;
}

.person-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: white;
    border: 2px solid #ddd;
}

.person-info {
    flex: 1;
}

.person-name {
    font-weight: bold;
    margin-bottom: 3px;
    color: #333;
    font-size: 14px;
}

.person-status {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 2px;
}

.person-time {
    font-size: 11px;
    color: #999;
}

.person-distance {
    font-size: 12px;
    color: #4a90e2;
    font-weight: 500;
    text-align: right;
}

/* チェックイン機能 */
.check-in-section {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* オンライン状態インジケーター */
.online-indicator {
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    right: 3px;
    border: 2px solid white;
}

.person-avatar {
    position: relative;
}

/* 空の状態 */
.no-people {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-people-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.no-people h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.no-people p {
    margin: 0;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .location-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .location-selector {
        justify-content: space-between;
    }
    
    .location-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .location-tab {
        font-size: 13px;
        padding: 12px;
    }
    
    .check-in-section {
        flex-direction: column;
    }
    
    .person-item {
        padding: 10px;
    }
    
    .person-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* 近くの犬セクション */
.nearby-section {
    margin-bottom: 20px;
}

.nearby-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.dog-list {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

.dog-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.dog-item:last-child {
    border-bottom: none;
}

.dog-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ddd;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.dog-info {
    flex: 1;
}

.dog-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.dog-info p {
    font-size: 12px;
    color: #666;
}

/* 散歩統計 */
.walk-stats {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    border: 2px solid #28a745;
}

.walk-stats h4 {
    margin-bottom: 15px;
    color: #28a745;
    font-size: 18px;
}

.walk-stats .stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.walk-stats .stat-item {
    text-align: center;
    flex: 1;
}

.walk-stats .stat-number {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 5px;
}

.walk-stats .stat-label {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

/* 散歩ボタン */
.walk-button {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    width: 100%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.walk-button:hover {
    background: linear-gradient(135deg, #218838, #1ea080);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* プロフィールセクション */
.profile-section {
    text-align: center;
}

.avatar-upload-section {
    margin-bottom: 20px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f0f0f0;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    overflow: hidden;
    border: 3px solid #ddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.profile-avatar:hover {
    border-color: #4a90e2;
    transform: scale(1.02);
}

#avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.default-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    position: relative;
}

.add-photo-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: #4a90e2;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.profile-avatar:hover .add-photo-icon {
    background: #357abd;
    transform: scale(1.1);
}

.photo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.overlay-content {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.overlay-btn {
    display: block;
    width: 100%;
    padding: 16px;
    margin-bottom: 10px;
    border: none;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.overlay-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.overlay-btn.remove {
    color: #dc3545;
}

.overlay-btn.remove:hover {
    background: #f8d7da;
}

.overlay-btn.cancel {
    background: #4a90e2;
    color: white;
    margin-bottom: 0;
}

.overlay-btn.cancel:hover {
    background: #357abd;
}

/* フォーム */
.profile-form {
    text-align: left;
    margin: 30px 0;
}

/* 横並びフォーム */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 120px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.save-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

/* 統計セクション */
.stats-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.stats-section h4 {
    margin-bottom: 15px;
    text-align: center;
}

.stats {
    display: flex;
    justify-content: space-around;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #4a90e2;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

/* ユーティリティクラス */
.hidden {
    display: none !important;
}

.screen {
    min-height: 100vh;
}

/* 散歩履歴 */
.history-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

.summary-item {
    text-align: center;
    flex: 1;
}

.summary-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #4a90e2;
    margin-bottom: 5px;
}

.summary-label {
    font-size: 12px;
    color: #666;
    line-height: 1.2;
}

.history-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.filter-btn:hover {
    background: #e9ecef;
}

.filter-btn.active:hover {
    background: #357abd;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

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

.history-date {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.history-time {
    font-size: 12px;
    color: #666;
}

.history-stats {
    display: flex;
    gap: 20px;
}

.history-stat {
    text-align: center;
    flex: 1;
}

.history-stat-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 2px;
}

.history-stat-label {
    font-size: 11px;
    color: #666;
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.no-history {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-history h4 {
    margin-bottom: 10px;
    color: #999;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .content {
        padding: 15px;
    }
    
    .map-container {
        height: 250px;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .summary-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .history-stats {
        gap: 10px;
    }
    
    .history-filters {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ローディングアニメーション */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* メッセージ機能のスタイル */
.message-view {
    position: relative;
    height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
}

/* 会話リスト */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.conversation-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.conversation-item:last-child {
    margin-bottom: 0;
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid #eee;
}

.conversation-info {
    flex: 1;
}

.conversation-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.conversation-last-message {
    font-size: 14px;
    color: #666;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 12px;
    color: #999;
    text-align: right;
}

.conversation-unread {
    width: 8px;
    height: 8px;
    background: #4a90e2;
    border-radius: 50%;
    margin-left: 10px;
}

/* チャット画面 */
.chat-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #eee;
    border-radius: 10px 10px 0 0;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.back-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #4a90e2;
    cursor: pointer;
    padding: 5px 10px;
    margin-right: 15px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #f0f7ff;
}

.chat-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    border: 2px solid #eee;
}

.chat-name-info h4 {
    margin: 0 0 2px 0;
    color: #333;
    font-size: 16px;
}

.chat-status {
    font-size: 12px;
    color: #28a745;
    margin: 0;
}

/* チャットメッセージエリア */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    max-height: calc(100vh - 300px);
}

.message-item {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-end;
}

.message-item.own {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message-item:not(.own) .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.message-item.own .message-bubble {
    background: #4a90e2;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.message-item:not(.own) .message-time {
    text-align: left;
}

/* チャット入力エリア */
.chat-input-area {
    background: white;
    border-radius: 25px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#message-input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    border-radius: 20px;
    background: #f8f9fa;
    font-size: 14px;
    outline: none;
    transition: background 0.3s ease;
}

#message-input:focus {
    background: #e9ecef;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4a90e2;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: #357abd;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 空のメッセージ状態 */
.no-conversations {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-conversations h4 {
    margin-bottom: 10px;
    color: #999;
}

.no-messages {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* タブが5つになったときの調整 */
.nav-tabs .tab {
    font-size: 12px;
    padding: 12px 8px;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .message-view {
        height: calc(100vh - 140px);
    }
    
    .chat-messages {
        max-height: calc(100vh - 280px);
    }
    
    .conversation-item {
        padding: 12px;
    }
    
    .conversation-avatar {
        width: 45px;
        height: 45px;
    }
    
    .chat-avatar {
        width: 35px;
        height: 35px;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 10px 14px;
    }
    
    .nav-tabs .tab {
        font-size: 10px;
        padding: 10px 5px;
    }
    
    /* フォーム横並びをモバイルで縦並びに */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
    
    /* アクションボタンのレスポンシブ */
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        font-size: 12px;
        padding: 10px 14px;
    }
    
    .action-buttons-section {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    /* 散歩統計のレスポンシブ */
    .walk-stats-section {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .walk-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .stat-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .walk-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .walk-control-btn {
        max-width: none;
        font-size: 12px;
        padding: 8px 14px;
    }
    
    /* マップコントロールボタンのサイズ調整 */
    .map-control-btn {
        font-size: 10px;
        padding: 6px 10px;
    }
}

/* 友達リストのグループ分け機能 */
.friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.friends-controls {
    display: flex;
    gap: 8px;
}

.add-group-btn, .manage-groups-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-group-btn:hover, .manage-groups-btn:hover {
    background: #357abd;
}

.manage-groups-btn {
    background: #6c757d;
}

.manage-groups-btn:hover {
    background: #5a6268;
}

/* グループフィルター */
.group-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.group-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.group-filter-btn.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.group-filter-btn:hover:not(.active) {
    background: #f8f9fa;
    border-color: #4a90e2;
}

/* 友達コンテナ */
.friends-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

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

.group-section:last-child {
    margin-bottom: 0;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4a90e2;
}

.group-title {
    font-weight: bold;
    color: #4a90e2;
    font-size: 16px;
}

.group-count {
    background: #4a90e2;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.group-friends {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 友達アイテムの強化 */
.dog-item {
    position: relative;
}

.friend-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dog-item:hover .friend-actions {
    opacity: 1;
}

.group-change-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.group-change-btn:hover {
    background: #5a6268;
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    max-height: 80%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.modal-header h4 {
    margin: 0;
    color: #333;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-modal-btn:hover {
    background: #e9ecef;
}

.modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* グループリスト */
.group-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.group-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.group-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.add-new-group-btn, .delete-group-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-new-group-btn {
    background: #28a745;
    color: white;
}

.add-new-group-btn:hover {
    background: #218838;
}

.delete-group-btn {
    background: #dc3545;
    color: white;
}

.delete-group-btn:hover {
    background: #c82333;
}

.existing-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.existing-group-name {
    font-weight: 500;
    color: #333;
}

/* 友達グループ変更モーダル */
.friend-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.friend-modal-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.friend-modal-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.group-selection h5 {
    margin: 0 0 15px 0;
    color: #333;
}

.group-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.group-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.group-checkbox-item:hover {
    background: #e9ecef;
}

.group-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.group-checkbox-label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions .save-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.modal-actions .save-btn:hover {
    background: #218838;
}

.modal-actions .cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.modal-actions .cancel-btn:hover {
    background: #5a6268;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .friends-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .friends-controls {
        justify-content: space-between;
    }
    
    .group-filters {
        gap: 5px;
    }
    
    .group-filter-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .friend-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}