/**
 * Custom Member Profile CSS - PC統一デザイン スマホ最適化版 v5
 * 端3px余白対応・イベントリストCSS削除版
 * Events Manager & BuddyPress 対応
 * MY予約もっと見る機能追加版
 */

/* ===== CSS変数（統一ブレークポイント） ===== */
:root {
    --primary-blue: #6c7ce7;
    --primary-green: #4ade80;
    --primary-orange: #f97316;
    --primary-red: #ef4444;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --bg-gray: #f9fafb;
    --border-gray: #e5e7eb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --container-margin: 3px;
    
    /* レスポンシブサイズ変数 */
    --avatar-size: 120px;
    --avatar-inner-size: 108px;
    --username-size: 24px;
    --stat-number-size: 18px;
    --stat-label-size: 10px;
    --nav-icon-size: 18px;
    --nav-label-size: 11px;
    --section-padding: 20px;
    --header-padding: 40px 20px 30px;
}

/* ===== リセットとベース ===== */
* {
    box-sizing: border-box;
}

body {
    background-color: #fff
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans CJK JP', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* ===== モーション設定対応 ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== BuddyPressカスタムレイアウト（端3px余白対応） ===== */
#buddypress.custom-member-layout {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    min-height: 100vh;
    position: relative;
    box-shadow: var(--shadow-sm);
}

/* 標準BuddyPressナビゲーションを隠す */
#buddypress.custom-member-layout .standard-bp-nav,
#buddypress.custom-member-layout .standard-bp-content {
    display: none !important;
}

/* ===== カスタムプロフィールヘッダー（端3px余白対応） ===== */
.custom-profile-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-gray);
    margin: 0 var(--container-margin);
}

.member-profile-container {
    width: 100%;
    margin: 0;
    padding: 0;
}

.profile-header {
    text-align: center;
    padding: var(--header-padding);
    background: var(--white);
    border-bottom: 1px solid var(--border-gray);
    margin: 0 var(--container-margin);
}

.profile-avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

/* ===== アバター（プロフィールページ専用） ===== */
.custom-member-layout .profile-header .avatar-wrapper {
    width: var(--avatar-size);
    height: var(--avatar-size);
    position: relative;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.custom-member-layout .profile-header .avatar-wrapper:hover {
    transform: scale(1.05);
}

.custom-member-layout .profile-header .avatar-ring {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50% !important;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.custom-member-layout .profile-header .avatar-ring .avatar-img,
.custom-member-layout .profile-header .avatar-ring .avatar,
.custom-member-layout .profile-header .avatar-ring img.avatar {
    width: var(--avatar-inner-size) !important;
    height: var(--avatar-inner-size) !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: none !important;
    display: block !important;
    transition: filter 0.3s ease;
    position: relative;
    clip-path: circle(50% at center);
    background: var(--white);
    max-width: var(--avatar-inner-size) !important;
    max-height: var(--avatar-inner-size) !important;
}

.custom-member-layout .profile-header .verified-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
    z-index: 2;
}

.custom-member-layout .profile-header .verified-badge::after {
    content: '✓';
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
}

/* ===== プロフィール情報 ===== */
.profile-info {
    margin-bottom: 25px;
}

.username {
    font-size: var(--username-size);
    font-weight: 600;
    color: var(--text-dark);
    margin: 10px 0 15px;
    line-height: 1.2;
}

/* ===== 統計セクション（常に4列レイアウト・端3px余白対応） ===== */
.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 25px var(--container-margin);
    padding: 0 10px;
    gap: 8px;
}

.stat-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    padding: 12px 4px;
    border-radius: var(--border-radius);
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-item:hover {
    transform: translateY(-2px);
    background: var(--bg-gray);
}

.stat-item:active {
    transform: translateY(0);
}

.stat-number {
    display: block;
    font-size: var(--stat-number-size);
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: var(--stat-label-size);
    color: var(--text-gray);
    line-height: 1.1;
    word-wrap: break-word;
    hyphens: auto;
    text-align: center;
    display: block;
}

/* 統計アイテムの順序別スタイル */
.stat-item:nth-child(1) .stat-number { color: var(--primary-green); } /* 参加イベント */
.stat-item:nth-child(2) .stat-number { color: var(--primary-blue); }  /* 参加グループ */
.stat-item:nth-child(3) .stat-number { color: var(--primary-orange); } /* 管理グループ */
.stat-item:nth-child(4) .stat-number { color: var(--primary-red); }   /* 主催イベント */

/* ===== アクションボタン（横並び維持・端3px余白対応） ===== */
.action-buttons {
    display: flex;
    gap: 8px;
    margin: 25px var(--container-margin);
    padding: 0 10px;
    flex-wrap: nowrap;
}

.btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 44px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: #5a6fd8;
    color: var(--white);
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
}

.btn-secondary:hover {
    background: #f3f4f6;
    color: var(--text-dark);
    border-color: var(--text-gray);
}

.btn-outline {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid var(--border-gray);
}

.btn-outline:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
    border-color: var(--text-gray);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
}

.btn-icon {
    font-size: 16px;
    line-height: 1;
}

.btn-text {
    font-weight: 600;
}

/* ===== プロフィール詳細（端3px余白対応） ===== */
.profile-details {
    padding: var(--section-padding);
    border-top: 1px solid var(--border-gray);
    background: var(--white);
    margin: 0 var(--container-margin);
}

.profile-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.profile-description {
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-line;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tag {
    background: var(--primary-blue);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.tag:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* ===== カスタムメインナビゲーション ===== */
.custom-main-nav {
    background: var(--white);
    border-top: 1px solid var(--border-gray);
    border-bottom: 1px solid var(--border-gray);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0 var(--container-margin);
}

.main-nav {
    background: var(--white);
}

.main-nav-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    max-width: 100%;
    background: var(--white);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-nav-container::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: var(--white);
    border: none;
    text-decoration: none;
    color: var(--text-gray);
    border-bottom: 3px solid transparent;
    min-width: 0;
}

.nav-tab:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
    text-decoration: none;
}

.nav-tab.active {
    color: var(--primary-blue);
    background: var(--white);
    border-bottom: 3px solid var(--primary-blue);
}

.nav-tab-icon {
    font-size: var(--nav-icon-size);
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.nav-tab:hover .nav-tab-icon {
    transform: scale(1.1);
}

.nav-tab-label {
    font-size: var(--nav-label-size);
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.nav-tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    margin-top: 2px;
    min-width: 16px;
    text-align: center;
}

.nav-tab.active .nav-tab-count {
    background: rgba(108, 124, 231, 0.2);
}

/* ===== カスタムコンテンツエリア（端3px余白対応） ===== */
.custom-content-area {
    background: var(--white);
    margin: 0 var(--container-margin);
}

.content-area {
    padding: var(--section-padding);
    min-height: 50vh;
    background: var(--white);
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ===== フィルタータブ ===== */
.filter-tabs {
    display: flex;
    gap: 6px;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
}

.filter-tab:hover {
    background: white;
    color: #374151;
}

.filter-tab.active {
    background: #6c7ce7;
    color: white;
}

.filter-icon {
    font-size: 12px;
}

.tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 9px;
    min-width: 14px;
    text-align: center;
}

/* ===== セクションタイトル ===== */
.section-title {
    margin-bottom: 20px;
}

.section-title-main {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    margin-top: 10px;
}

.section-icon {
    font-size: 24px;
    line-height: 1;
}

.section-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.2;
}

.section-count {
    background-color: var(--bg-gray);
    color: var(--text-gray);
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    margin-left: auto;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-gray);
    margin: 0;
}

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

.group-item {
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    padding: 16px;
    transition: var(--transition);
    border: 1px solid var(--border-gray);
}

.group-item:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.group-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.group-info h4 a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.group-info h4 a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.group-description {
    font-size: 14px;
    color: var(--text-gray);
    margin: 4px 0;
    line-height: 1.4;
}

.group-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.group-members,
.group-admin,
.group-status {
    font-size: 12px;
    color: var(--text-gray);
    background: rgba(108, 124, 231, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

.group-admin {
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
}

/* ===== 活動履歴 ===== */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    transition: var(--transition);
    border-left: 4px solid var(--primary-blue);
}

.activity-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: var(--white);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.activity-meta {
    display: flex;
    gap: 12px;
    margin: 4px 0 8px 0;
    font-size: 12px;
}

.activity-count {
    background: var(--primary-blue);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.activity-description {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.4;
}

/* ===================================================================
   MYデータタブ専用スタイル（端3px余白対応）
   ================================================================= */

.mydata-content-wrapper {
    max-width: 100%;
}

.mydata-section {
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    padding: var(--section-padding);
    margin: 0 var(--container-margin) 20px;
    border: 1px solid var(--border-gray);
}

.mydata-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-gray);
}

.mydata-section-title .section-icon {
    font-size: 20px;
}

/* プロフィールフィールド */
.profile-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-field {
    background: var(--white);
    padding: 16px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-gray);
    transition: var(--transition);
}

.profile-field:hover {
    box-shadow: var(--shadow-sm);
}

.profile-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.field-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field-value {
    font-size: 14px;
    color: var(--text-gray);
    flex: 1;
    word-break: break-all;
}

.field-edit-link,
.field-edit-btn {
    background: var(--primary-blue);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.field-edit-link:hover,
.field-edit-btn:hover {
    background: #5a6fd8;
    text-decoration: none;
    transform: translateY(-1px);
}

/* フィールド編集用のコンテナとスタイル */
.field-edit-container {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-gray);
}

.field-input,
.field-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: var(--white);
}

.field-input:focus,
.field-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(108, 124, 231, 0.1);
}

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

.field-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.field-save-btn,
.field-cancel-btn {
    padding: 6px 12px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.field-save-btn {
    background: var(--primary-green);
    color: var(--white);
}

.field-save-btn:hover {
    background: #22c55e;
}

.field-cancel-btn {
    background: var(--text-light);
    color: var(--white);
}

.field-cancel-btn:hover {
    background: var(--text-gray);
}

.field-validation-message {
    font-size: 12px;
    color: var(--primary-red);
    margin-top: 4px;
}

.field-char-counter {
    font-size: 11px;
    color: var(--text-light);
    text-align: right;
    margin-top: 4px;
}

.field-help-text {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* タグ選択用のスタイル */
.tags-selector {
    margin-bottom: 12px;
}

.tags-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.selector-instruction {
    font-size: 13px;
    color: var(--text-gray);
    margin: 0;
}

.selected-count {
    font-size: 12px;
    color: var(--text-gray);
}

.available-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-option {
    position: relative;
    cursor: pointer;
}

.tag-option input[type="checkbox"] {
    display: none;
}

.tag-checkbox {
    display: inline-block;
    padding: 6px 12px;
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-gray);
}

.tag-option input[type="checkbox"]:checked + .tag-checkbox {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.tag-option:hover .tag-checkbox {
    border-color: var(--primary-blue);
    background: rgba(108, 124, 231, 0.1);
}

.current-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mini-tag {
    background: var(--primary-blue);
    color: var(--white);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* ===== MY予約セクション（もっと見る機能付き） ===== */
.my-bookings-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 16px;
}

.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.booking-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.booking-item:hover {
    border-color: #c3c4c7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.booking-item.hidden-booking {
    opacity: 0;
    transform: translateY(10px);
}

.booking-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.booking-event-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.booking-event-name a {
    color: #1e40af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.booking-event-name a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.booking-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.booking-date {
    color: #6b7280;
    font-size: 0.9rem;
}

.booking-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.booking-status.status-1 {
    background: #dcfce7;
    color: #166534;
}

.booking-status.status-0 {
    background: #fef3c7;
    color: #92400e;
}

.booking-status.status-2 {
    background: #fee2e2;
    color: #991b1b;
}

.booking-status.status-3 {
    background: #f3f4f6;
    color: #6b7280;
}

.booking-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.booking-date-created {
    position: relative;
}

.booking-spaces {
    position: relative;
}

.booking-spaces::before {
    content: '•';
    margin-right: 0.5rem;
    color: #d1d5db;
}

/* もっと見るボタンコンテナ */
.bookings-toggle-container {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid #f3f4f6;
}

.bookings-toggle-container .btn {
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.bookings-show-more {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.bookings-show-more:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.bookings-show-less {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.bookings-show-less:hover {
    background: #fecaca;
    border-color: #fca5a5;
    color: #7f1d1d;
}

/* ボタンアニメーション */
.bookings-toggle-container .btn .btn-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.bookings-show-more .btn-icon {
    animation: bounce-down 2s ease-in-out infinite;
}

.bookings-show-less .btn-icon {
    animation: bounce-up 2s ease-in-out infinite;
}

@keyframes bounce-down {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

@keyframes bounce-up {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(3px);
    }
    60% {
        transform: translateY(2px);
    }
}

/* プライバシー制限状態のスタイル */
.privacy-restricted {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    color: var(--text-gray);
    margin: 20px 0;
}

.privacy-restricted .bp-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    color: #94a3b8;
}

.privacy-restricted h2,
.privacy-restricted h3 {
    color: #475569;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.privacy-restricted p {
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 14px;
}

.profile-private-notice {
    padding: 2rem;
    margin: 2rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

/* タブ内のプライバシー制限状態 */
.tab-content.privacy-restricted {
    display: block;
    opacity: 1;
    transform: none;
}

/* プライバシー制限時のボタンスタイル */
.privacy-restricted .btn {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.privacy-restricted .btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    text-decoration: none;
}

/* プライバシー制限時のアニメーション */
.privacy-restricted {
    animation: fadeInPrivacy 0.5s ease;
}

@keyframes fadeInPrivacy {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.privacy-settings {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 16px;
}

.privacy-item {
    padding: 16px;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    background: var(--bg-gray);
    margin-bottom: 16px;
}

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

.privacy-item label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.privacy-description {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.4;
    margin-bottom: 12px;
}

.privacy-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.privacy-value {
    font-size: 14px;
    color: var(--text-gray);
    flex: 1;
}

.privacy-edit-btn {
    background: var(--primary-blue);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.privacy-edit-btn:hover {
    background: #5a6fd8;
    text-decoration: none;
    transform: translateY(-1px);
}

.privacy-edit-container {
    margin-top: 12px;
    padding: 12px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-gray);
}

.privacy-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.privacy-option {
    cursor: pointer;
    position: relative;
}

.privacy-option input[type="radio"] {
    display: none;
}

.privacy-radio {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 2px solid var(--border-gray);
    border-radius: var(--border-radius);
    transition: var(--transition);
    background: var(--bg-gray);
}

.privacy-option input[type="radio"]:checked + .privacy-radio {
    border-color: var(--primary-blue);
    background: rgba(108, 124, 231, 0.1);
}

.privacy-radio:hover {
    border-color: var(--primary-blue);
    background: rgba(108, 124, 231, 0.05);
}

.privacy-icon {
    font-size: 20px;
    line-height: 1;
    margin-top: 2px;
}

.privacy-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.privacy-label strong {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 600;
}

.privacy-label small {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.3;
}

.privacy-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.privacy-save-btn,
.privacy-cancel-btn {
    padding: 6px 12px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.privacy-save-btn {
    background: var(--primary-green);
    color: var(--white);
}

.privacy-save-btn:hover {
    background: #22c55e;
}

.privacy-cancel-btn {
    background: var(--text-light);
    color: var(--white);
}

.privacy-cancel-btn:hover {
    background: var(--text-gray);
}

.privacy-validation-message {
    font-size: 12px;
    color: var(--primary-red);
    margin-top: 4px;
}

/* プライバシートグル設定 */
.privacy-toggles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.privacy-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-gray);
    transition: var(--transition);
}

.privacy-toggle-item:hover {
    box-shadow: var(--shadow-sm);
}

.toggle-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toggle-icon {
    font-size: 18px;
    line-height: 1;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.toggle-description {
    font-size: 12px;
    color: var(--text-gray);
}

/* カスタムトグルスイッチ */
.privacy-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.privacy-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s ease;
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.privacy-switch input:checked + .switch-slider {
    background-color: var(--primary-blue);
}

.privacy-switch input:checked + .switch-slider:before {
    transform: translateX(20px);
}

.privacy-switch:hover .switch-slider {
    box-shadow: 0 0 0 3px rgba(108, 124, 231, 0.1);
}

/* プライバシー通知 */
.privacy-notice {
    margin-top: 16px;
    padding: 12px 16px;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: var(--border-radius);
    animation: slideInDown 0.3s ease;
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notice-icon {
    font-size: 16px;
    line-height: 1;
}

.notice-text {
    font-size: 14px;
    color: #166534;
    font-weight: 500;
}

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

/* ===== 空のコンテンツ ===== */
.empty-content,
.bp-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    color: var(--text-gray);
}

.empty-icon,
.bp-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    display: block;
}

.empty-content:hover .empty-icon,
.bp-empty-state:hover .bp-empty-icon {
    opacity: 1;
    transform: scale(1.1);
    transition: var(--transition);
}

.empty-title,
.bp-empty-state h3 {
    color: #374151;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.empty-subtitle,
.bp-empty-state p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 14px;
}

.empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== エラーメッセージ ===== */
.error-message,
.bp-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin: 20px var(--container-margin);
    text-align: center;
    font-size: 14px;
}

.bp-notice {
    background: #e7f3ff;
    color: #004085;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin: 16px var(--container-margin);
}

/* ===== アニメーション効果 ===== */
.clicking {
    transform: scale(0.95) !important;
    transition: transform 0.1s ease !important;
}

.pulse {
    animation: pulseEffect 0.6s ease-in-out !important;
}

@keyframes pulseEffect {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ローディング状態 */
.bookings-list.loading {
    opacity: 0.6;
    pointer-events: none;
}

.bookings-toggle-container .btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== フォーカス指示の改善 ===== */
.btn:focus,
.nav-tab:focus,
.filter-tab:focus,
.field-edit-link:focus,
.field-edit-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ===== 隠し要素 ===== */
.hidden {
    display: none !important;
}

/* ===== ダークモード対応 ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f9fafb;
        --text-gray: #d1d5db;
        --text-light: #9ca3af;
        --bg-gray: #111827;
        --border-gray: #374151;
        --white: #1f2937;
    }
    
    body {
        background-color: var(--bg-gray);
        color: var(--text-dark);
    }
}

/* ===== スマホサイズ最適化（PCデザイン維持・端3px余白対応） ===== */

/* 極小画面（320px以下） */
@media (max-width: 320px) {
    :root {
        --avatar-size: 100px;
        --avatar-inner-size: 90px;
        --username-size: 20px;
        --stat-number-size: 16px;
        --stat-label-size: 8px;
        --nav-icon-size: 16px;
        --nav-label-size: 9px;
        --section-padding: 12px;
        --header-padding: 25px 12px 20px;
    }
    
    .stats-section {
        gap: 6px;
        padding: 0 8px;
    }
    
    .stat-item {
        padding: 10px 2px;
    }
    
    .action-buttons {
        gap: 6px;
        padding: 0 8px;
    }
    
    .btn {
        padding: 8px 8px;
        font-size: 12px;
        gap: 2px;
    }
    
    .nav-tab {
        padding: 10px 4px;
    }
    
    .nav-tab-count {
        font-size: 7px;
        padding: 1px 3px;
    }
    
    .filter-tab {
        font-size: 10px;
        padding: 5px 8px;
    }
    
    .main-nav-container {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
    
    .booking-item {
        padding: 1rem;
    }
    
    .booking-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .booking-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .booking-spaces::before {
        content: '';
        margin-right: 0;
    }
}

/* スマホ（321px〜480px） */
@media (min-width: 321px) and (max-width: 480px) {
    :root {
        --avatar-size: 110px;
        --avatar-inner-size: 98px;
        --username-size: 22px;
        --stat-number-size: 17px;
        --stat-label-size: 9px;
        --nav-icon-size: 17px;
        --nav-label-size: 10px;
        --section-padding: 16px;
        --header-padding: 30px 16px 25px;
    }
    
    .stats-section {
        gap: 6px;
        padding: 0 8px;
    }
    
    .stat-item {
        padding: 11px 3px;
    }
    
    .action-buttons {
        gap: 6px;
        padding: 0 8px;
    }
    
    .btn {
        padding: 9px 10px;
        font-size: 13px;
        gap: 3px;
    }
    
    .nav-tab {
        padding: 11px 5px;
    }
    
    .nav-tab-count {
        font-size: 8px;
        padding: 1px 4px;
    }
    
    .filter-tab {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .main-nav-container {
        grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
    }
    
    .booking-item {
        padding: 1rem;
    }
    
    .booking-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .booking-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .booking-spaces::before {
        content: '';
        margin-right: 0;
    }
}

/* タブレット小（481px〜600px） */
@media (min-width: 481px) and (max-width: 600px) {
    /* デフォルト値をそのまま使用（PCと同じ） */
}

/* タブレット大（601px〜768px） */
@media (min-width: 601px) and (max-width: 768px) {
    /* デフォルト値をそのまま使用（PCと同じ） */
}

/* デスクトップ（769px〜） */
@media (min-width: 769px) {
    .stats-section {
        gap: 12px;
    }
    
    .stat-item:hover {
        transform: translateY(-3px);
    }
    
    .main-nav-container {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .action-buttons {
        gap: 12px;
    }
}

/* 高解像度ディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .custom-member-layout .profile-header .avatar-ring .avatar-img,
    .custom-member-layout .profile-header .avatar-ring .avatar,
    .custom-member-layout .profile-header .avatar-ring img.avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* タッチデバイス用の調整 */
@media (pointer: coarse) {
    .btn,
    .nav-tab,
    .filter-tab {
        min-height: 44px;
    }
    
    .stat-item {
        min-height: 44px;
        padding: 8px 4px;
    }
    
    .field-edit-link,
    .field-edit-btn {
        min-height: 32px;
        padding: 6px 12px;
    }
}

/* プリント時のスタイル */
@media print {
    .custom-main-nav,
    .action-buttons,
    .field-edit-link,
    .field-edit-btn,
    .bookings-toggle-container {
        display: none;
    }
    
    .tab-content {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .profile-header {
        page-break-after: avoid;
    }
    
    .mydata-section {
        page-break-inside: avoid;
    }
    
    .booking-item.hidden-booking {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }
}