/* CSSファイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

/* メインコンテナ */
.container {
    display: flex;
    min-height: 100vh;
}

/* 左側サイドバー */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background-color: #34495e;
    border-bottom: 1px solid #3b4d63;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: bold;
}

/* メニューナビゲーション */
.sidebar-nav {
    padding: 20px 0;
}

.menu {
    list-style: none;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-item a {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.menu-item a:hover {
    background-color: #3b4d63;
}

.menu-item.active a {
    background-color: #3498db;
    color: white;
}

/* メインコンテンツエリア */
.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 30px;
}

.content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 28px;
}

.content p {
    color: #7f8c8d;
    line-height: 1.6;
    font-size: 16px;
}

/* ページ切り替え機能 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ボタンスタイル */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    margin-right: 5px;
}

/* テーブル内の操作ボタン */
.data-table td .btn-small {
    margin-right: 8px;
    white-space: nowrap;
}

.data-table td .btn-small:last-child {
    margin-right: 0;
}

/* ページアクション */
.page-actions {
    margin-bottom: 30px;
}

/* 統計グリッド */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #7f8c8d;
    font-size: 14px;
    font-weight: normal;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-number.error {
    color: #e74c3c;
}

.stat-change {
    font-size: 12px;
    font-weight: bold;
}

.stat-change.positive {
    color: #27ae60;
}

.stat-change.negative {
    color: #e74c3c;
}

/* テーブルコンテナ */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.table-container h2 {
    padding: 20px 20px 0 20px;
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

/* データテーブル */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th,
.data-table td {
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* 求人タイトルリンク */
.job-title-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.job-title-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ステータスセレクト */
.status-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #333;
    font-size: 12px;
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: #3498db;
}

/* ステータス表示 */
.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.status.active {
    background-color: #d4edda;
    color: #155724;
}

.status.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* ログレベル表示 */
.log-level {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.log-level.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.log-level.warning {
    background-color: #fff3cd;
    color: #856404;
}

.log-level.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* フィルター・選択要素 */
.analytics-period,
.log-filters {
    margin-bottom: 30px;
}

.period-select,
.log-type-select,
.date-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

/* チャートプレースホルダー */
.chart-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.chart-container h2 {
    padding: 20px 20px 0 20px;
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    border: 2px dashed #ecf0f1;
    margin: 20px;
    border-radius: 8px;
}

/* 求人詳細ページスタイル */
.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.back-btn {
    flex-shrink: 0;
}

.job-detail-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.job-info-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.job-basic-info {
    padding: 25px;
    border-bottom: 1px solid #ecf0f1;
}

.info-row {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row label {
    width: 120px;
    font-weight: bold;
    color: #2c3e50;
    flex-shrink: 0;
}

.info-row span {
    color: #7f8c8d;
}

.job-description,
.job-requirements {
    padding: 25px;
    border-bottom: 1px solid #ecf0f1;
}

.job-requirements:last-child {
    border-bottom: none;
}

.job-description h3,
.job-requirements h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
}

.job-description p,
.job-requirements p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.job-description ul,
.job-requirements ul {
    margin: 10px 0;
    padding-left: 20px;
}

.job-description li,
.job-requirements li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.job-stats-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stats-card h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

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

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

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
}

.stat-value {
    font-weight: bold;
    color: #2c3e50;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.full-width {
    width: 100%;
    justify-content: center;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .job-detail-container {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* アナリティクス機能の拡張スタイル */
.analytics-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.period-controls,
.group-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-period {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

.custom-period span {
    color: #7f8c8d;
}

.group-controls label {
    font-weight: bold;
    color: #2c3e50;
}

/* チャートタブ */
.chart-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    color: #7f8c8d;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-btn:hover {
    color: #2980b9;
}

/* チャートコンテンツ */
.chart-content {
    display: none;
}

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

.chart-placeholder canvas {
    max-width: 100%;
    height: auto;
}

/* 月別テーブル */
.monthly-table-container {
    overflow-x: auto;
}

.monthly-table {
    white-space: nowrap;
}

.change-indicator {
    font-size: 12px;
    font-weight: bold;
}

.change-indicator.positive {
    color: #27ae60;
}

.change-indicator.negative {
    color: #e74c3c;
}

.change-indicator.neutral {
    color: #7f8c8d;
}

/* グループ分析 */
.group-analysis {
    margin-top: 30px;
}

.group-summary {
    margin-bottom: 30px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.summary-card h4 {
    margin: 0 0 10px 0;
    color: #7f8c8d;
    font-size: 12px;
    font-weight: normal;
}

.summary-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* アナリティクス用レスポンシブ対応 */
@media (max-width: 768px) {
    .analytics-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .period-controls,
    .group-controls {
        justify-content: space-between;
    }

    .custom-period {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* パターン設定モーダル */
.modal {
    position: fixed !important;
    z-index: 1000;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5);
    display: none !important;
    /* デフォルトで非表示 */
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    box-sizing: border-box;
}

/* モーダルが表示される時のクラス */
.modal.show {
    display: flex !important;
}

/* 複製モーダル専用の確実な中央配置 */
#copyOptionsModal,
#locationCopyModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s ease-out;
    position: relative;
    margin: auto;
}

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

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s ease;
    line-height: 1;
    padding: 4px;
    border: none;
    background: none;
}

.close:hover {
    color: #2c3e50;
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    margin-bottom: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

.pattern-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 30px;
}

.pattern-form label {
    font-weight: bold;
    color: #2c3e50;
    min-width: 70px;
}

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

.pattern-list h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.pattern-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pattern-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-family: monospace;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #ecf0f1;
}

/* 新しい求人詳細表示用スタイル */
.job-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.job-detail h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.job-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.job-stats span {
    color: #2c3e50;
    font-weight: bold;
}

.job-section {
    margin-bottom: 20px;
}

.job-section h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 16px;
}

.job-content,
.job-requirements {
    background-color: #f8f9fa;
    padding: 10px 12px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    line-height: 1.4;
    white-space: pre-line;
    cursor: help;
    font-size: 14px;
    max-height: 60px;
    overflow: hidden;
}

.job-content:hover,
.job-requirements:hover {
    background-color: #e9ecef;
}

.back-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.back-button:hover {
    background-color: #5a6268;
}

/* 求人作成・編集フォーム */
.job-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    background-color: #fafafa;
}

.form-section h2 {
    color: #2c3e50;
    margin-bottom: 24px;
    font-size: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

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

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

.required {
    background-color: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 8px;
}

.optional {
    background-color: #95a5a6;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 8px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-note {
    margin-top: 6px;
    font-size: 12px;
    color: #7f8c8d;
}

.char-count {
    font-weight: bold;
    color: #2c3e50;
}

.char-limit {
    color: #95a5a6;
}

/* チェックボックスグループ */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    padding-left: 28px;
}

.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-item .checkmark {
    position: absolute;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.checkbox-item:hover input~.checkmark {
    border-color: #3498db;
}

.checkbox-item input:checked~.checkmark {
    background-color: #3498db;
    border-color: #3498db;
}

.checkbox-item .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-item input:checked~.checkmark:after {
    display: block;
}

/* ラジオボタングループ */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.radio-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    padding-left: 28px;
}

.radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-item .radio-mark {
    position: absolute;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.radio-item:hover input~.radio-mark {
    border-color: #3498db;
}

.radio-item input:checked~.radio-mark {
    background-color: #3498db;
    border-color: #3498db;
}

.radio-item .radio-mark:after {
    content: "";
    position: absolute;
    display: none;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.radio-item input:checked~.radio-mark:after {
    display: block;
}

/* タググループ */
.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background-color: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.tag:hover {
    background-color: #d5dbdb;
    border-color: #95a5a6;
}

.tag.tag-active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

/* 写真アップロードエリア */
.photo-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: #f9f9f9;
}

.uploaded-photo {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.uploaded-photo img {
    width: 200px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.photo-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.photo-info {
    margin-top: 8px;
    font-size: 12px;
    color: #7f8c8d;
}

.photo-add-btn {
    margin-top: 12px;
}

/* 場所・給与関連 */
.location-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.location-group select {
    flex: 0 0 120px;
}

.location-group input {
    flex: 1;
}

.salary-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.salary-group select {
    flex: 0 0 100px;
}

.salary-range {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.salary-range input[type="number"] {
    width: 120px;
}

/* フォームアクション */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.form-actions .btn {
    min-width: 120px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .job-form {
        margin: 0;
    }

    .form-section {
        padding: 16px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .location-group {
        flex-direction: column;
    }

    .location-group select {
        flex: none;
    }

    .salary-group {
        flex-direction: column;
        align-items: stretch;
    }

    .salary-range {
        flex-direction: column;
        align-items: stretch;
    }

    .salary-range input[type="number"] {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* 求人詳細画面のスタイル */
.job-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e8ed;
}

.job-detail-header h3 {
    margin: 0;
    color: #2c3e50;
    flex: 1;
}

.job-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.job-stats span {
    font-weight: 600;
    color: #555;
}

.job-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
}

.job-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
    border-bottom: 1px solid #e1e8ed;
    padding-bottom: 5px;
}

.job-section div {
    color: #555;
    line-height: 1.6;
}

/* 求人作成・編集ページのレイアウト */
.job-create-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* タイムラインが非表示の時は中央配置 */
.job-create-layout.center-content {
    justify-content: center;
}

.job-create-layout.center-content .job-create-main {
    max-width: 800px;
}

.job-create-main {
    flex: 2;
    min-width: 0;
}

.job-create-sidebar {
    flex: 1;
    min-width: 400px;
    max-width: 500px;
}

/* タイムラインが非表示の時はサイドバーを隠す */
.job-create-sidebar[style*="display: none"] {
    display: none !important;
}

/* 編集履歴タイムライン */
.edit-timeline-panel {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 24px;
    position: sticky;
    top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.edit-timeline-panel h3 {
    margin: 0 0 24px 0;
    color: #2c3e50;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.history-timeline {
    position: relative;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

.history-timeline::-webkit-scrollbar {
    width: 6px;
}

.history-timeline::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.history-timeline::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.history-timeline::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ddd;
    border-radius: 1px;
}

.history-item {
    position: relative;
    padding-left: 45px;
    margin-bottom: 25px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px 20px 20px 45px;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.history-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 25px;
    width: 10px;
    height: 10px;
    background: #3498db;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #ddd;
    z-index: 2;
}

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

.history-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.history-field {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
}

.history-change {
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
}

.history-change .old-value {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: line-through;
    display: inline;
    margin-right: 8px;
}

.history-change .new-value {
    background: #d4edda;
    color: #155724;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline;
    margin-left: 8px;
}

.history-change .arrow {
    color: #6c757d;
    margin: 0 4px;
    font-weight: bold;
}

.no-history {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .job-create-layout {
        flex-direction: column;
    }

    .job-create-sidebar {
        min-width: unset;
        max-width: unset;
        width: 100%;
        order: -1;
    }

    .edit-timeline-panel {
        position: static;
        margin-bottom: 30px;
    }

    .history-timeline {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .job-create-layout {
        gap: 20px;
    }

    .edit-timeline-panel {
        padding: 16px;
        margin-bottom: 20px;
    }

    .edit-timeline-panel h3 {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .history-item {
        padding: 12px 12px 12px 40px;
        margin-bottom: 16px;
    }

    .history-timeline {
        max-height: 300px;
    }
}

/* =======================
   複製機能のスタイル
   ======================= */

/* 複製オプション選択モーダル */
.copy-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.copy-option-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    text-align: left;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-height: 90px;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.copy-option-btn:hover::before {
    left: 100%;
}

.copy-option-btn:hover {
    background: #e8f4f8;
    border-color: #007bff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
}

.copy-option-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.copy-option-btn strong {
    font-size: 17px;
    color: #2c3e50;
    margin-bottom: 6px;
    display: block;
    font-weight: 600;
}

.copy-option-btn small {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
}

/* 勤務地指定複製モーダル */
.location-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
    margin-bottom: 15px;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

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

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

.location-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* ボタンのサイズバリエーション */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #4e555b;
}

/* フォームグループのスタイル調整 */
.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #333;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    margin-bottom: 15px;
}

.form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* モーダルフッターのスタイル */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px 24px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.modal-footer .btn {
    min-width: 100px;
    font-weight: 500;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }

    .modal-content {
        max-height: 95vh;
        border-radius: 10px;
    }

    .modal-header {
        padding: 20px 20px 16px 20px;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 20px;
    }

    .copy-options {
        gap: 12px;
    }

    .copy-option-btn {
        padding: 18px;
        min-height: 80px;
        border-radius: 8px;
    }

    .copy-option-btn strong {
        font-size: 15px;
    }

    .copy-option-btn small {
        font-size: 12px;
    }

    .location-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px 20px 20px;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
    }

    .modal-footer .btn {
        width: 100%;
    }
}