/*
========================================
Kaiteki - デザイナー向けフィードバックツール
統合スタイルシート
========================================
*/

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

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #FFFAF7;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

/* ===========================================
   共通コンポーネント
=========================================== */

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    outline: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: #FF7919;
    color: white;
    border-color: #FF7919;
}

.btn-primary:hover {
    background: #ea580c;
}

.btn-secondary {
    background: #1A1A1A;
    color: #fff;
}

.btn-secondary:hover {
    background: #888;
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: #f97316;
    border-color: #f97316;
}

.btn-outline:hover {
    background: #f97316;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    padding: 6px;
}

.btn-link {
    background: none;
    border: none;
    color: #f97316;
    text-decoration: underline;
    padding: 0;
    font-size: inherit;
    cursor: pointer;
}

.btn-link:hover {
    color: #ea580c;
    transform: none;
    box-shadow: none;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

/* 基本的なinputスタイル */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
select,
.form-input,
.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
    line-height: 1.5;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
select:focus,
.form-input:focus,
.search-input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder,
input[type="tel"]::placeholder,
input[type="url"]::placeholder,
input[type="search"]::placeholder,
.form-input::placeholder,
.search-input::placeholder {
    color: #9ca3af;
}

/* 無効化されたinput */
input:disabled,
select:disabled,
.form-input:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ファイル入力 */
input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    transition: all 0.2s ease;
}

input[type="file"]:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* チェックボックスとラジオボタン */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: #f97316;
}

/* テキストエリア */
textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* アラート・メッセージ */
.alert,
.message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-success,
.message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error,
.message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* モーダル共通スタイル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal:hover {
    color: #374151;
    background: #e5e7eb;
}

.modal-body {
    padding: 24px;
}

/* 共通レイアウト */
main.container {
    margin-top: 70px;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {

    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);

    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/*
.page-title {
    margin-bottom: 32px;
}
*/

.page-title h1 {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.page-title p {
    font-size: 16px;
    color: #6b7280;
}

/* エンプティステート */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.5;
}


/* ===========================================
   ダッシュボードページ（dashboard.php）
=========================================== */

/* ダッシュボードヘッダー */
.dashboard-header {
    height: 95px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-left {
    display: flex;
    align-items: center;
}

.header-left .logo {
    margin: 0;
}

.header-left .logo img {
    height: 40px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #FCFCFC;
    border-radius: 20px;
    font-size: 14px;
    color: #FF7919;
    font-weight: 500;
    line-height: 1.6;
    border: 1px solid #FF7919;
}

.notification-btn {
    position: relative;
    background: #FF7919;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    line-height: 1.6;
}

.notification-btn:hover {
    background: #ea580c;
}

.notification-btn .fa-bell-o {
    filter: brightness(0) invert(1);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #fff;
}

.logout-btn {
    background: #1A1A1A;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    line-height: 1.6;
}

.logout-btn:hover {
    background: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

@media (max-width: 768px) {
    .dashboard-header {
        height: 66px;
    }

    .header-right .text {
        display: none;
    }

    .user-info {
        width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    .notification-btn {
        width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logout-btn {
        width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .username-tooltip {
        display: none;
        position: absolute;
        bottom: -12px;
        left: 50%;
        transform: translate(-50%, 100%);
        background-color: #fff;
        color: #fff;
        padding: 5px 10px;
        border-radius: 5px;
        font-size: 14px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
        box-shadow: 0 0px 5px rgba(0, 0, 0, 0.2);
        color: #FF7919;
    }
}

/* プロジェクト作成セクション */
.create-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.create-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111827;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

/* ファイルアップロードエリア */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #f97316;
    background: #fff7ed;
    transform: translateY(-2px);
}

.upload-icon {
    color: #9ca3af;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.upload-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.upload-btn {
    background: #f97316;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background: #ea580c;
}

.file-input-hidden {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: none;
}

/* ファイルプレビュー */
.file-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.clear-files-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 6px;
}

.file-item-icon {
    color: #f97316;
    font-size: 18px;
}

.file-item-info {
    flex: 1;
}

.file-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.file-item-size {
    font-size: 12px;
    color: #6b7280;
}

.file-item-remove {
    background: #ef4444;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
    border-radius: 12px;
    background: #f97316;
    border: none;
    color: #fff;
    cursor: pointer;
}

.create-btn:hover {
    background: #ea580c;
}

/* プロジェクト一覧セクション */
.projects-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.projects-header {
    margin-bottom: 24px;
}

.projects-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 20px;
}

.project-card {
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

/*
.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #f97316;
}
*/

.project-image {
    width: 100%;
    height: auto;
    display: block;
    background: #f3f4f6;
}

.project-info-open {
    display: none;
    transition: all 0.3s ease;
    background: #fff;
    width: calc(100% - 40px - 25px);
    position: absolute;
    top: 5px;
    right: 55px;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.project-info-open .project-name {
    border-bottom: 1px solid #8B8B8B;
    padding: 10px 7px;
}

.project-info-open .project-name .ttl {
    font-size: 14px;
    font-weight: bold;
    color: #1A1A1A;
}

.project-info-open .project-name .date {
    font-size: 12px;
    color: #6b7280;
}

.project-info-open .project-actions {
    padding: 10px 7px;

}

.project-info-open .project-actions .project-actions-btn {
    font-size: 14px;
    display: block;
    text-decoration: none;
    border: none;
    background: #fff;
    width: 100%;
    text-align: left;
    color: #1A1A1A;
}

.project-info-open .project-actions .project-actions-btn .fa {
    width: 14px;
}

.project-info-open .project-actions .project-actions-btn:hover {
    opacity: 0.7;
}

.project-info-open.open {
    display: block;
}

.project-info-more {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 7px;
    top: 5px;
    right: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-info-more span {
    width: 4px;
    height: 4px;
    background: #000;
    border-radius: 50%;
    margin: 3px;
}

.project-info-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* ダッシュボードのプロジェクトカード内のサムネイル画像のみに高さ制限を適用 */
.project-card .project-image {
    height: 12rem;
    max-height: 12rem;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.project-info {
    padding: 10px 0;
}

.project-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 5px;
    color: #111827;
}

.project-deadline {
    color: #f97316;
    font-size: 13px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-date {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 5px;
}

.project-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.project-actions .btn {
    font-size: 12px;
    padding: 6px 12px;
}

/* 通知モーダル */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.notification-modal.active {
    opacity: 1;
    visibility: visible;
}

.notification-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90vw;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.notification-modal.active .notification-content {
    transform: scale(1) translateY(0);
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.notification-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.close-notification {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-notification:hover {
    color: #374151;
    background: #e5e7eb;
}

.notification-actions {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

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

.notification-item {
    padding: 16px 24px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: #fff7ed;
    border-left: 4px solid #f97316;
}

.notification-info {
    display: flex;
    gap: 12px;
}

.notification-icon {
    color: #f97316;
    font-size: 20px;
    margin-top: 2px;
}

.notification-details {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.notification-text {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.notification-time {
    font-size: 12px;
    color: #9ca3af;
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.notification-empty h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

/* 複製モーダル */
.duplicate-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.duplicate-modal.active {
    opacity: 1;
    visibility: visible;
}

.duplicate-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90vw;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.duplicate-modal.active .duplicate-content {
    transform: scale(1) translateY(0);
}

.duplicate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.duplicate-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-duplicate {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-duplicate:hover {
    color: #374151;
    background: #e5e7eb;
}

.duplicate-body {
    padding: 24px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.project-preview {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.project-preview h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.preview-stat {
    text-align: center;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.preview-stat-icon {
    color: #f97316;
    font-size: 20px;
    margin-bottom: 8px;
}

.preview-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.preview-stat-label {
    font-size: 12px;
    color: #6b7280;
}

.duplicate-options {
    margin-bottom: 24px;
}

.option-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-card:hover {
    border-color: #f97316;
    background: #f9fafb;
}

.option-card.selected {
    border-color: #f97316;
    background: #fff7ed;
}

.option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.option-checkbox {
    margin: 0;
}

.option-icon {
    color: #f97316;
    font-size: 18px;
}

.option-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.option-description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin-left: 40px;
}

.sub-option {
    margin-top: 12px;
    margin-left: 20px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.name-suffix-input {
    margin-top: 8px;
    margin-left: 40px;
    max-width: 200px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.status-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: none;
    font-size: 14px;
}

.status-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.duplicate-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.cancel-btn {
    background: #1A1A1A;
    color: #fff;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
}

.cancel-btn:hover {
    background: #888;
}

.duplicate-btn {
    background: #FF7919;
    color: white;
    border: 1px solid #FF7919;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.duplicate-btn:hover {
    background: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.duplicate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
@media (max-width: 768px) {
    .duplicate-actions{
        display: flex;
        justify-content: center;
        gap: 8px;
    }
    .duplicate-actions .cancel-btn{
        width: 48%;
    }
    .duplicate-actions .duplicate-btn{
        width: 48%;
    }
}
/* ===========================================
   プロジェクト表示ページ（project-view.php）
=========================================== */

/* プロジェクトヘッダー */
.project-header {
    height: 95px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.project-header .header {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-header .header .header-left {
    position: absolute;
    left: 20px;
}

.project-header .header .header-logo img {
    height: 40px;
}

.project-header .header .header-controls {
    position: absolute;
    right: 20px;
}

.project-title {
    margin-left: 20px;
}

/* モバイル用コンパクトヘッダー */
@media (max-width: 768px) {
    .project-header {
        height: 66px;
    }


    .project-title {
        font-size: 16px !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 200px;
    }

    .project-deadline-badge {
        display: none;
        /* モバイルでは非表示 */
    }

    .header-controls {
        gap: 8px;
    }

    .header-controls .btn {
        padding: 6px 8px;
        font-size: 12px;
    }

    .btn-icon-only {
        width: 38px;
        height: 38px;
        padding: 4px;
    }
}

.back-btn {
    background: #1A1A1A;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.back-btn:hover {
    background: #888;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 12px;
}

/*
.project-title .truncate-title {
    display: inline-block;
    max-width: 12em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
*/
.project-deadline-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 1380px) {
    .project-title .truncate-title {
        font-size: 16px;
    }
}

@media (max-width: 1280px) {
    .project-title {
        flex-wrap: wrap;
        gap: 5px;
    }

    .project-title .truncate-title {
        display: inline-block;
        width: 100%;
    }
}

@media (max-width: 980px) {
    .project-header .header .header-logo {
        padding-left: 15%;
    }
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* メインコンテナ */
.main-container {
    display: flex;
    height: calc(100vh - 95px);
    overflow: hidden;
}

@media (max-width: 768px) {
    .main-container {
        height: calc(100vh - 66px);
        flex-direction: column;
    }

    .project-header .header .header-logo {
        padding-left: 0;
    }
}

.project-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    position: relative;
}

@media (max-width: 768px) {
    .project-container {
        flex: none;
        height: 100%;
        background: #ffffff;
    }
}

/* 画像セクション */
.image-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-container {
    flex: 1;
    position: relative;
    overflow: auto;
    background: #f3f4f6;
    display: block;
    cursor: crosshair;
    /* マウスカーソルを十字に変更 */
}

.image-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* 画像ホバー時のオーバーレイ */
.image-hover-overlay {
    position: fixed;
    /* JavaScriptで位置を制御 */
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 5;
}

/* オーバーレイの説明テキスト */
.image-hover-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInScale 0.2s ease;
    white-space: nowrap;
}

/* タッチデバイスではホバー効果を無効化 */
@media (hover: none) and (pointer: coarse) {
    .image-container {
        cursor: default;
    }

    .image-hover-overlay {
        display: none !important;
    }
}

/* ホバーアニメーション */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.project-image {
    width: 100%;
    height: auto;
    display: block;
    /* box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); */
    /* border-radius: 8px; */
}

/* コメントピン */
.comment-pin {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.comment-pin::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
}

.comment-pin:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 11;
}

.comment-pin.highlighted {
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 12;
    animation: pinPulse 1s ease-in-out infinite;
}

@keyframes pinPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.comment-pin.status-pending {
    background: #f59e0b;
}



.comment-pin.status-resolved {
    background: #10b981;
}

.comment-pin.temp-pin {
    background: #007bff;
    z-index: 15;
}

/* ページナビゲーション */
.page-navigation {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.page-navigation .page-count {
    font-size: 14px;
    font-weight: bold;
    color: #1A1A1A;
}

/* スマホ版でページナビゲーションを非表示 */
@media (max-width: 768px) {
    .page-navigation {
        display: none !important;
    }
}

.page-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
}

.page-select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-btn {
    color: #1A1A1A;
    border: none;
    padding: 6px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: none;
}

/*
.page-btn:hover:not(:disabled) {
    background: #e2e8f0;
    transform: translateX(-1px);
}
*/
.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 統合コメントパネル */
.unified-comments-panel {
    width: 380px;
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* モバイル用ボトムシート */
@media (max-width: 768px) {
    .unified-comments-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        order: 2;
        width: 100%;
        height: 70vh;
        max-height: 70vh;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        display: none;
        overflow: hidden;
    }

    .unified-comments-panel.visible {
        display: flex;
        transform: translateY(0);
    }

    .unified-comments-panel.medium {
        height: 50vh;
    }

    .unified-comments-panel.large {
        height: 80vh;
    }

    /* ボトムシートオーバーレイ */
    .bottom-sheet-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        display: none;
    }

    .bottom-sheet-overlay.visible {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    /* ボトムシートクローズボタン */
    .bottom-sheet-close {
        position: absolute;
        top: 12px;
        right: 16px;
        background: none;
        border: none;
        color: #6b7280;
        cursor: pointer;
        font-size: 20px;
        padding: 4px;
        border-radius: 4px;
        transition: all 0.2s ease;
        z-index: 10;
    }

    .bottom-sheet-close:hover {
        color: #374151;
        background: #f3f4f6;
    }
}

/* PCではオーバーレイとクローズボタンを非表示 */
@media (min-width: 769px) {

    .bottom-sheet-overlay,
    .bottom-sheet-close {
        display: none !important;
    }
}

/* FABボタン */
.fab-button {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 999 !important;
    transition: all 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
}

.fab-button:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 25px rgba(249, 115, 22, 0.5);
}

.fab-button:active {
    transform: scale(0.95) !important;
}

/* FABボタンのコメント数バッジ */
.fab-button .comment-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fab-button .comment-count-badge.hidden {
    display: none;
}

@media (max-width: 768px) {
    .fab-button {
        display: flex !important;
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        z-index: 999 !important;
    }
}



.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #FFFAF7;
}

@media (max-width: 768px) {
    .panel-header {
        padding: 12px 16px;
        background: white;
        border-bottom: 1px solid #f3f4f6;
    }
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.panel-title span {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.back-to-list {
    background: none;
    border: none;
    color: #f97316;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    gap: 4px;
}

.back-to-list:hover {
    background: #fff7ed;
}

.comments-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-box {
    position: relative;
}

.search-input {
    padding-left: 12px;
    /* アイコン削除に伴い標準のパディングに戻す */
    font-size: 13px;
    height: 36px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-tab {
    background: #1A1A1A;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-tab:hover {
    background: #888;
}

.filter-tab.active {
    background: #f97316;
    color: white;
    border-color: #f97316;
}

/* フィルタータブの件数バッジ */
.count-badge {
    background: rgba(0, 0, 0, 0.15);
    color: inherit;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-tab:not(.active) .count-badge {
    background: #555;
    color: #fff;
}

.filter-tab:hover .count-badge {
    background: #aaa;
}

.count-badge.important {
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
}

.filter-tab.active .count-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.filter-tab.active .count-badge.important {
    background: rgba(255, 255, 255, 0.5);
    color: white;
    font-weight: 700;
}

.panel-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.comments-list-view,
.comment-detail-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: white;
    z-index: 1;
}

.comments-list-view {
    display: block;
}

.comments-list-view.hidden {
    display: none;
}

.comment-detail-view {
    display: none;
}

.comment-detail-view.active {
    display: block;
    z-index: 2;
}

.comments-list {
    padding: 0;
}

/* コメントページヘッダー（グループ化用） */
.comment-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #FF7919;
    border-bottom: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 5;
    cursor: pointer;
    transition: background 0.2s ease;
}

.comment-page-header:hover {
    background: #ea580c;
}

.comment-page-header:first-child {
    border-top: none;
}

.comment-page-header .page-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.comment-page-header .fa-file-o{
    color: #fff;
}

.comment-page-header .page-comment-count {
    font-size: 12px;
    color: #fff;
    font-weight: 500;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .comment-page-header {
        padding: 10px 16px;
        font-size: 13px;
    }

    .comment-page-header .page-title {
        font-size: 13px;
    }

    .comment-page-header .page-comment-count {
        font-size: 11px;
    }
}

.comment-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s ease;
}

.comment-item:hover {
    background: #FFFAF7;
}

.comment-item.highlighted {
    background: #fff7ed;
    border-left: 4px solid #f97316;
    animation: itemHighlight 2s ease-in-out;
}

@keyframes itemHighlight {

    0%,
    100% {
        background: #fff7ed;
    }

    50% {
        background: #fed7aa;
    }
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* コメントメニュー（三点リーダー） */
.comment-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.comment-menu-trigger {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.comment-menu-trigger:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.comment-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    padding: 4px 0;
}

.comment-menu-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 3px 16px;
    border: none;
    background: none;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.menu-item:hover {
    background: #f9fafb;
}

.menu-item.danger {
    color: #dc2626;
}

.menu-item.danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.menu-item i {
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.menu-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 4px 0;
}

.menu-item.status-selector {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    cursor: default;
    padding: 8px 16px;
}

.menu-item.status-selector:hover {
    background: none;
}

.menu-item.status-selector span {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.status-select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    color: #374151;
}

.status-select:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

/* ステータス切り替えボタン */
.status-toggle-btn {
    transition: all 0.2s ease;
    font-weight: 500;
}

.status-toggle-btn.status-pending {
    color: #4FAA00;
}

.status-toggle-btn.status-pending:hover {
    background: #ecfdf5;
    color: #047857;
}

.status-toggle-btn.status-resolved {
    color: #f59e0b;
}

.status-toggle-btn.status-resolved:hover {
    background: #fffbeb;
    color: #d97706;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .comment-menu-dropdown {
        right: -8px;
        min-width: 140px;
    }

    .menu-item {
        padding: 10px 12px;
        font-size: 14px;
    }

    .menu-item i {
        width: 16px;
    }
}

.comment-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.comment-status-badge.status-pending {
    background: #FF7919;
    color: #fff;
}

.comment-menu .fa-ellipsis-h{
    color: #1A1A1A;
}

.comment-status-badge.status-resolved {
    background: #8B8B8B;
    color: #fff;
}

.comment-page-info {
    background: #fff;
    color: #1A1A1A;
    border: 1px solid #1A1A1A;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

.comment-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.comment-author {
    color: #6b7280;
}

.comment-author.admin-author {
    color: #f97316;
    font-weight: 500;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}
.comment-author.admin-author img{
    margin-right: 5px;
}

.comment-author.guest-author {
    color: #4FAA00;
    font-weight: 500;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}
.comment-author.guest-author img{
    margin-right: 5px;
}

.comment-date {
    color: #9ca3af;
}

.locate-pin-btn {
    background: none;
    border: none;
    color: #f97316;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 2px;
}

.locate-pin-btn:hover {
    background: #fff7ed;
    color: #ea580c;
}

/* コメント詳細ビュー */
.comment-detail {
    padding: 20px;
}

.comment-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.comment-detail-text {
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-detail-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.5;
}

.comment-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.comment-status-select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    background: white;
}

/* コメント編集ビュー */
.comment-edit-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: white;
    z-index: 1;
    display: none;
}

.comment-edit-view.active {
    display: block;
    z-index: 2;
}

/* コメントフォーム */
.comment-form {
    padding: 20px;
}

.comment-form textarea {
    margin-bottom: 16px;
    min-height: 120px;
}

.comment-form-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* コメント編集フォーム（旧式・削除予定） */
.comment-edit-form {
    padding: 20px;
    display: none;
}

.comment-edit-form.active {
    display: block;
}

/* 共有モーダル */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-modal.active {
    opacity: 1;
    visibility: visible;
}

.share-url-container {
    margin-bottom: 20px;
}

.share-url-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.share-url-input {
    display: flex;
    gap: 8px;
}

.share-url {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #f9fafb;
}

.share-actions {
    margin-bottom: 20px;
}

.share-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
}

.share-info p {
    margin: 0 0 8px 0;
    font-weight: 500;
    color: #0c4a6e;
}

.share-info ul {
    margin: 8px 0 0 20px;
    color: #0369a1;
}

.share-info li {
    margin-bottom: 4px;
    font-size: 13px;
}

/* フルスクリーンオーバーレイ */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    /* 半透明背景 */
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 終了ボタンのスタイル */
.fullscreen-overlay .fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.4);
    /* より透過 */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2001;
    backdrop-filter: blur(10px);
}

.fullscreen-overlay .fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    /* ホバー時も調整 */
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fullscreen-image-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.fullscreen-image-container:active {
    cursor: grabbing;
}

.fullscreen-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* フルスクリーンでピンを非表示 */
.fullscreen-overlay .comment-pin {
    display: none;
}

/* モバイル対応のフルスクリーンボタン */
@media (max-width: 768px) {
    .fullscreen-overlay .fullscreen-btn {
        top: 15px;
        right: 15px;
        padding: 8px 16px;
        font-size: 13px;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .fullscreen-overlay .fullscreen-btn {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 12px;
        gap: 4px;
    }
}

/* ===========================================
   プロジェクト編集ページ（edit-project.php）
=========================================== */

/* 編集ページヘッダー */
.edit-header .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    height: 64px;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.save-btn {
    background: linear-gradient(135deg, #10b981 0%, #4FAA00 100%);
    color: white;
    border: 1px solid #4FAA00;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.save-btn:hover {
    background: linear-gradient(135deg, #4FAA00 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* 編集セクション */
.edit-section {
    background: white;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.section-header {
    background: #f9fafb;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.section-body {
    padding: 24px;
}

/* ページ管理 */
.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.page-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: move;
    transition: all 0.2s ease;
}

.page-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #f97316;
}

.page-card.sortable-ghost {
    opacity: 0.5;
}

.page-card.sortable-chosen {
    transform: rotate(2deg);
    z-index: 10;
}

.main-page-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f97316;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
}

.page-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: #f3f4f6;
}

.page-info {
    padding: 12px;
}

.page-number {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.page-actions {
    display: flex;
    gap: 6px;
}

.page-action-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-action-btn:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.page-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ページ追加エリア */
.add-page-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.add-page-area:hover,
.add-page-area.dragover {
    border-color: #f97316;
    background: #fff7ed;
    /* transform: translateY(-2px); 振動問題のため削除 */
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.add-page-icon {
    color: #9ca3af;
    margin-bottom: 16px;
}

.add-page-text {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
}

.add-page-btn {
    background: #f97316;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-page-btn:hover {
    background: #ea580c;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* 進行状況オーバーレイ */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.progress-overlay.active {
    opacity: 1;
    visibility: visible;
}

.progress-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 90vw;
}

.progress-icon {
    color: #f97316;
    margin-bottom: 20px;
}

.progress-text {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.progress-detail {
    font-size: 14px;
    color: #6b7280;
}

/* ===========================================
   共有ページ（shared.php）
=========================================== */

/* 共有ページヘッダー */
.shared-header {
    height: 95px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.shared-header .header {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shared-header .header-guest {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shared-header .logo {
    font-size: 24px;
    font-weight: 700;
    color: #f97316;
}

.shared-header .header .header-left {
    position: absolute;
    left: 20px;
}

.shared-header .header .header-logo img {
    height: 40px;
}

.shared-header .header .header-controls {
    position: absolute;
    right: 20px;
}

.shared-header .project-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.shared-header .project-title>span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

@media (max-width: 1280px) {
    .shared-header .project-title {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: start;
    }

}

.shared-header .header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guest-badge {
    background: #f59e0b;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ゲストコメントエリア */
.guest-comment-area {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    display: none;
}

.guest-comment-area.active {
    display: block;
}

.guest-comment-title {
    font-size: 14px;
    font-weight: 600;
    color: #0c4a6e;
    margin-bottom: 4px;
}

.guest-comment-help {
    font-size: 12px;
    color: #0369a1;
    margin-bottom: 12px;
}

.guest-name-container {
    position: relative;
}

.guest-name-status {
    position: absolute;
    top: -24px;
    left: 0;
    font-size: 11px;
    color: #4FAA00;
    display: none;
    align-items: center;
    gap: 4px;
}

.guest-name-input {
    margin-bottom: 8px;
    font-size: 13px;
}

.guest-name-input.guest-name-saved {
    background: #f0fdf4;
    border-color: #a7f3d0;
    color: #065f46;
}

.guest-name-actions {
    display: flex;
    gap: 12px;
    font-size: 11px;
}

/* ===========================================
   レスポンシブデザイン
=========================================== */

/* タブレット（768px以下） */
@media (max-width: 768px) {
    main.container {
        margin-top: 50px;
    }

    .container {
        padding: 0 16px;
    }

    .header {
        padding: 0 16px;
    }

    /* ダッシュボード */
    .form-row {
        flex-direction: column;
        gap: 16px;
    }

    .projects-section {
        padding: 20px 15px;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .project-actions {
        justify-content: space-between;
    }

    .project-actions .btn {
        flex: 1;
        justify-content: center;
        min-width: auto;
    }

    .project-card {
        overflow: unset;
    }

    .project-info-open {
        width: calc(100% + 15px);
        max-width: 250px;
        position: absolute;
        top: 45px;
        right: 0px;
    }

    .project-info-more {
        width: 35px;
        height: 35px;
    }

    .project-info-more span {
        margin: 2px;
    }

    /* プロジェクト表示 */
    .main-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 66px);
    }

    .project-container {
        order: 1;
        min-height: 50vh;
    }

    .project-container.collapsed {
        min-height: 20vh;
    }

    .unified-comments-panel {
        order: 2;
        width: 100%;
        height: 70vh;
        max-height: 70vh;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        overflow: hidden;
    }

    .unified-comments-panel.expanded {
        height: 80vh;
        max-height: 80vh;
    }

    .collapse-control {
        display: flex !important;
    }

    /* 共有ページヘッダー - モバイル */
    .shared-header .header {
        padding: 12px 16px;
        height: 56px;
        min-height: 56px;
        gap: 8px;
    }

    .shared-header .header-guest {
        gap: 8px;
    }

    .shared-header .logo {
        font-size: 20px;
    }

    .shared-header .project-title {
        font-size: 14px;
        justify-content: flex-start;
        flex: 1;
        min-width: 0;
    }

    .shared-header .project-title>span:first-child {
        max-width: 150px;
    }

    .shared-header .project-deadline-badge {
        display: none;
    }

    .shared-header .header-controls .btn {
        padding: 6px;
        width: 32px;
        height: 32px;
    }

    /* ページナビゲーション */
    .page-navigation {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .page-info {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .page-controls {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }

    /* コメントパネル */
    .panel-header {
        padding: 16px 20px;
    }

    .comments-filters {
        gap: 8px;
    }

    .filter-tabs {
        gap: 2px;
    }

    .filter-tab {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* 編集ページ */
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .page-image {
        height: 100px;
    }

    /* モーダル */
    .modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
    }

    .modal-header,
    .modal-body {
        padding: 16px 20px;
    }

    .duplicate-options {
        margin-bottom: 16px;
    }

    .option-card {
        padding: 12px;
    }

    .duplicate-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* モバイル（480px以下） */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .header {
        padding: 0 12px;
    }

    /* 共有ページヘッダー - 小さなモバイル */
    .shared-header .header {
        padding: 10px 12px;
        height: 48px;
        min-height: 48px;
    }

    .shared-header .logo {
        font-size: 18px;
    }

    .shared-header .project-title {
        font-size: 13px;
    }

    .shared-header .project-title>span:first-child {
        max-width: 120px;
    }

    .guest-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .shared-header .header-controls .btn {
        width: 28px;
        height: 28px;
        padding: 4px;
    }

    /* コメントパネル */
    .panel-header {
        padding: 12px 16px;
    }

    .panel-title span {
        font-size: 16px;
    }

    .comment-item {
        padding: 12px 16px;
    }

    .comment-text {
        font-size: 13px;
    }

    .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* 編集ページ */
    .pages-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .page-image {
        height: 80px;
    }

    .page-info {
        padding: 8px;
    }

    .page-number {
        font-size: 12px;
    }

    /* フォーム */
    .form-input,
    .search-input {
        font-size: 16px;
        /* iOS Safari での自動ズームを防ぐ */
    }

    textarea {
        font-size: 16px;
        min-height: 80px;
    }
}

/* プリント用スタイル */
@media print {

    .header,
    .unified-comments-panel,
    .page-navigation,
    .modal-overlay,
    .notification-modal,
    .duplicate-modal,
    .share-modal,
    .fullscreen-overlay,
    .progress-overlay {
        display: none !important;
    }

    .main-container {
        height: auto;
        flex-direction: column;
    }

    .project-container {
        width: 100%;
    }

    .image-container {
        overflow: visible;
        height: auto;
    }

    .project-image {
        max-width: 100%;
        height: auto;
        box-shadow: none;
    }

    .comment-pin {
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #fff !important;
        box-shadow: 0 0 0 2px #000 !important;
    }
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        border-color: #000;
    }

    .btn-secondary {
        background: #fff;
        color: #000;
        border-color: #000;
    }

    .comment-pin {
        border-width: 3px;
    }

    .comment-status-badge {
        border: 1px solid #000;
    }
}

/* 動きを減らす設定 */
@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;
    }

    .comment-pin.highlighted {
        animation: none;
    }

    .comment-item.highlighted {
        animation: none;
    }
}

/* ダークモード対応（将来的な拡張用） */
@media (prefers-color-scheme: dark) {
    /* 必要に応じてダークモードスタイルを追加 */
}

/* ===========================================
   モバイルハンバーガーメニュー
=========================================== */

/* ハンバーガーメニューボタン */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #475569;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-right: 8px;
    position: absolute;
    left: 20px;
}

.mobile-menu-toggle:hover {
    background: #f1f5f9;
    color: #334155;
}

/* モバイルメニュー本体 */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    height: 100dvh;
    /* 動的ビューポート高さ */
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    /* iOSセーフエリア対応 */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-menu.active {
    left: 0;
}

/* メニューヘッダー */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f97316;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.mobile-menu-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* メニューコンテンツ */
.mobile-menu-content {
    padding: 20px;
    padding-bottom: 20px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ゲスト情報表示 */
.mobile-menu-guest-info {
    background: #f0f9ff;
    color: #0369a1;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* メニューセクション */
.mobile-menu-section {
    margin-bottom: 24px;
}

.mobile-menu-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ページリスト */
.mobile-page-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-page-list li {
    margin-bottom: 4px;
}

.mobile-page-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
}

.mobile-page-link:hover {
    background: #f9fafb;
    color: #111827;
}

.mobile-page-link.active {
    background: #fff7ed;
    color: #f97316;
    font-weight: 500;
}

.mobile-page-link i {
    width: 16px;
    text-align: center;
}

.current-badge {
    position: absolute;
    right: 12px;
    background: #f97316;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* メニューアクション */
.mobile-menu-actions {
    margin-top: 20px;
    padding-bottom: 20px;
}

.mobile-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.mobile-menu-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mobile-menu-btn i {
    width: 20px;
    text-align: center;
}

.mobile-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

/* iOSツールバー対策用スペーサー */
.mobile-menu-spacer {
    height: 80px;
    flex-shrink: 0;
}

/* iOSセーフエリアを考慮 */
@supports (height: env(safe-area-inset-bottom)) {
    .mobile-menu-spacer {
        height: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

/* メニューオーバーレイ */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1099;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* デスクトップ専用クラス */
.desktop-only {
    display: inline-flex;
}



/* モバイル表示設定 */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    /* ヘッダーの調整 */
    .project-header .header,
    .shared-header .header {
        gap: 8px;
    }

    .project-title {
        flex: 1;
        min-width: 0;
    }

    .project-title>span:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ヘッダーコントロールの調整 */
    .header-controls {
        gap: 4px;
    }

    /* 既存のモバイルスタイルとの競合を避ける */
    .shared-header .header-guest {
        display: none !important;
    }
}

/* タブレット以上では非表示 */
@media (min-width: 769px) {

    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* ===========================================
   ユーティリティクラス
=========================================== */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-primary {
    color: #f97316;
}

.text-secondary {
    color: #6b7280;
}

.text-success {
    color: #4FAA00;
}

.text-danger {
    color: #dc2626;
}

.text-warning {
    color: #d97706;
}

.bg-primary {
    background-color: #f97316;
}

.bg-secondary {
    background-color: #f1f5f9;
}

.bg-success {
    background-color: #ecfdf5;
}

.bg-danger {
    background-color: #fef2f2;
}

.bg-warning {
    background-color: #fffbeb;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

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

.mt-6 {
    margin-top: 24px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

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

.mb-6 {
    margin-bottom: 24px;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 4px;
}

.p-2 {
    padding: 8px;
}

.p-3 {
    padding: 12px;
}

.p-4 {
    padding: 16px;
}

.p-5 {
    padding: 20px;
}

.p-6 {
    padding: 24px;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.grid {
    display: grid;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.gap-5 {
    gap: 20px;
}

.gap-6 {
    gap: 24px;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-scroll {
    overflow: scroll;
}

.rounded {
    border-radius: 6px;
}

.rounded-lg {
    border-radius: 8px;
}

.rounded-xl {
    border-radius: 12px;
}

.rounded-full {
    border-radius: 9999px;
}

.shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.shadow-xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.border {
    border: 1px solid #e5e7eb;
}

.border-t {
    border-top: 1px solid #e5e7eb;
}

.border-b {
    border-bottom: 1px solid #e5e7eb;
}

.border-l {
    border-left: 1px solid #e5e7eb;
}

.border-r {
    border-right: 1px solid #e5e7eb;
}

.transition {
    transition: all 0.2s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.3s ease;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-move {
    cursor: move;
}

.cursor-grab {
    cursor: grab;
}

.cursor-grabbing {
    cursor: grabbing;
}

.select-none {
    user-select: none;
}

.pointer-events-none {
    pointer-events: none;
}

/* ===========================================
   アニメーション
=========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    40%,
    43% {
        transform: translate3d(0, -8px, 0);
    }

    70% {
        transform: translate3d(0, -4px, 0);
    }

    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-in-out;
}

.animate-fadeOut {
    animation: fadeOut 0.3s ease-in-out;
}

.animate-slideInUp {
    animation: slideInUp 0.3s ease-out;
}

.animate-slideInDown {
    animation: slideInDown 0.3s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.3s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.3s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease-out;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ===========================================
   ローディングオーバーレイ
=========================================== */

/* ローディングオーバーレイ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ローディングコンテンツ */
.loading-content {
    text-align: center;
    padding: 40px;
}

/* ローディングスピナー */
.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    position: relative;
}

/* 円形のスピナー */
.spinner-circle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid #f3f4f6;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 内側の円 */
.spinner-inner {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 3px solid #f3f4f6;
    border-bottom-color: #ea580c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite reverse;
}

/* ローディングテキスト */
.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* プログレスバー */
.loading-progress {
    width: 200px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
    width: 0%;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* 代替アニメーション：ドットローディング */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.loading-dot {
    width: 12px;
    height: 12px;
    background: #f97316;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===========================================
   カスタムスクロールバー
=========================================== */

/* Webkit ブラウザ用 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

::-webkit-scrollbar-corner {
    background: #f1f5f9;
}

/* Firefox用 */
html {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* ===========================================
   フォーカス管理（アクセシビリティ）
=========================================== */

/* キーボードフォーカス時のアウトライン */
*:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* マウスフォーカス時はアウトラインを非表示 */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ボタンのフォーカス状態 */
.btn:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* 入力フィールドのフォーカス状態 */
.form-input:focus,
.search-input:focus,
textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* リンクのフォーカス状態 */
a:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* ===========================================
   完了
=========================================== */