/**
 * PC版共通スタイル
 * 全画面で使用するリセット、CSS変数、アニメーション、アプリレイアウト
 */

/* 基本リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", Meiryo;
    color: #1e293b;
}

/* ブランドカラー定義 */
:root {
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --sky-500: #0ea5e9;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --red-500: #ef4444;
    --red-50: #fef2f2;
    --green-50: #f0fdf4;
    --green-600: #16a34a;
}

/* アニメーション定義 */
@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

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

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

/* ========================================
   PC版アプリケーションレイアウト
   ======================================== */

.pc-app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* サイドバー */
.pc-sidebar {
    width: 220px;
    min-width: 220px;
    background: #1a2234;
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, min-width 0.3s ease;
    overflow: hidden;
    position: relative;
    z-index: 100;
}

.sidebar-collapsed .pc-sidebar {
    width: 0;
    min-width: 0;
}

.pc-sidebar-logo {
    padding: 16px 12px;
    display: flex;
    align-items: center;
    background: #fff;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pc-sidebar-logo img {
    max-width: 150%;
    height: auto;
    max-height: 65px;
    object-fit: contain;
    margin-left: 2px;
}

.pc-sidebar-nav {
    padding: 8px 0;
    flex: 1;
}

.pc-sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1rem;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.pc-sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.pc-sidebar-nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-left: 3px solid #fff;
    padding-left: 17px;
}

.pc-sidebar-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* メインエリア */
.pc-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #f0f2f5;
}

/* ヘッダー */
.pc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

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

.pc-sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a2234;
    border-radius: 4px;
}

.pc-sidebar-toggle:hover {
    background: #f0f2f5;
}

.pc-header-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a2234;
    white-space: nowrap;
}

.pc-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a2234;
    font-size: 1rem;
}

.pc-header-user-icon {
    color: #1a2234;
    font-size: 1.5rem;
}

.pc-header-user-name {
    font-size: 1rem;
}

/* ユーザードロップダウントリガーボタン */
.pc-user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.pc-user-dropdown-toggle:hover {
    background: #f0f2f5;
}

.pc-dropdown-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

/* ユーザードロップダウンコンテナ */
.pc-user-dropdown {
    position: relative;
}

/* ドロップダウンメニュー（AdminLTEスタイル） */
.pc-user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 1000;
    overflow: hidden;
}

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

.pc-user-dropdown.open .pc-dropdown-arrow {
    transform: rotate(180deg);
}

/* ユーザーメニューフッター（AdminLTEスタイル） */
.pc-user-footer {
    padding: 10px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* ページコンテンツ */
.pc-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* ログアウトボタン */
.btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 3px;
    text-decoration: none;
}

.btn-default {
    color: #444;
    background-color: #f4f4f4;
    border-color: #ddd;
}

.btn-default:hover {
    background-color: #e7e7e7;
    border-color: #ccc;
}

.btn-flat {
    border-radius: 0;
    box-shadow: none;
    border-width: 1px;
}

.btn-block {
    display: block;
    width: 100%;
}

.text-red {
    color: #dd4b39 !important;
}

/* ========================================
   PC版カスタムカレンダー（jQuery UI Datepicker）
   ======================================== */

/* Datepicker入力フィールド */
.em-datepicker-input {
    cursor: pointer;
    min-width: 150px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat right 8px center;
    padding-right: 32px;
}

/* jQuery UI Datepicker 基本スタイル（大きめ） */
.ui-datepicker {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    width: 380px !important;
    padding: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background: #fff;
    z-index: 1000 !important;
}

/* ヘッダー部分 */
.ui-datepicker .ui-datepicker-header {
    background: transparent;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 0 12px 0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* 年月タイトル（中央） */
.ui-datepicker .ui-datepicker-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    line-height: 1;
}

/* 年セレクトボックス */
.ui-datepicker .ui-datepicker-year {
    font-size: 1rem;
    font-weight: 600;
    padding: 6px 28px 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 8px center;
    cursor: pointer;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-width: 100px;
}

.ui-datepicker .ui-datepicker-year:hover {
    border-color: #80bdff;
}

.ui-datepicker .ui-datepicker-year:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 月セレクトボックス */
.ui-datepicker .ui-datepicker-month {
    font-size: 1rem;
    font-weight: 600;
    padding: 6px 28px 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 8px center;
    cursor: pointer;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-width: 80px;
}

.ui-datepicker .ui-datepicker-month:hover {
    border-color: #80bdff;
}

.ui-datepicker .ui-datepicker-month:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 前月・翌月ボタン */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    position: static;
    width: 36px;
    height: 36px;
    cursor: pointer;
    border-radius: 4px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    top: auto;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    background: #e8ecf1;
    border-color: #ccc;
}

.ui-datepicker .ui-datepicker-prev .ui-icon,
.ui-datepicker .ui-datepicker-next .ui-icon {
    display: none;
}

.ui-datepicker .ui-datepicker-prev::after {
    content: '';
    width: 10px;
    height: 10px;
    border-left: 2px solid #555;
    border-bottom: 2px solid #555;
    transform: rotate(45deg);
    margin-left: 3px;
}

.ui-datepicker .ui-datepicker-next::after {
    content: '';
    width: 10px;
    height: 10px;
    border-right: 2px solid #555;
    border-top: 2px solid #555;
    transform: rotate(45deg);
    margin-right: 3px;
}

/* カレンダーテーブル */
.ui-datepicker table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

/* 曜日ヘッダー */
.ui-datepicker th {
    padding: 10px 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    text-align: center;
    background: transparent;
    border: none;
}

/* 日曜（赤） */
.ui-datepicker th:first-child {
    color: #dc3545;
}

/* 土曜（青） */
.ui-datepicker th:last-child {
    color: #007bff;
}

/* 日付セル */
.ui-datepicker td {
    padding: 2px;
    border: none;
    background: transparent;
}

.ui-datepicker td a,
.ui-datepicker td span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0 auto;
    font-size: 1rem;
    text-align: center;
    border-radius: 4px;
    transition: all 0.15s;
    text-decoration: none;
}

/* デフォルト状態 */
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
    border: none;
    background: transparent;
    color: #333;
    font-weight: normal;
}

/* ホバー状態 */
.ui-datepicker td a:hover {
    background: #e8ecf1;
    color: #333;
}

/* 選択された日付 */
.ui-datepicker .ui-state-active {
    background: #3b4a6b !important;
    color: #fff !important;
    font-weight: 600 !important;
    border: none !important;
}

/* 日曜の日付（赤） */
.ui-datepicker td:first-child a {
    color: #dc3545;
}

.ui-datepicker td:first-child .ui-state-active {
    background: #dc3545 !important;
    color: #fff !important;
}

/* 土曜の日付（青） */
.ui-datepicker td:last-child a {
    color: #007bff;
}

.ui-datepicker td:last-child .ui-state-active {
    background: #007bff !important;
    color: #fff !important;
}

/* 祝日の日付（赤） */
.ui-datepicker td.ui-datepicker-holiday a {
    color: #dc3545 !important;
}

.ui-datepicker td.ui-datepicker-holiday .ui-state-active {
    background: #dc3545 !important;
    color: #fff !important;
}

/* 無効な日付 */
.ui-datepicker .ui-state-disabled {
    opacity: 0.4;
}

.ui-datepicker .ui-state-disabled span {
    color: #999;
}

/* 今日ボタンエリア */
.ui-datepicker .ui-datepicker-buttonpane {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* 今日ボタン */
.ui-datepicker .ui-datepicker-current {
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    opacity: 1;
}

.ui-datepicker .ui-datepicker-current:hover {
    background: #0056b3;
}

/* 閉じるボタン（非表示） */
.ui-datepicker .ui-datepicker-close {
    display: none;
}

/* 今日リセット時の曜日色を復元（日曜） */
.ui-datepicker-calendar:has(.ui-state-active) td:first-child .ui-state-highlight:not(.ui-state-active) {
    color: #dc3545 !important;
}

/* 今日リセット時の曜日色を復元（土曜） */
.ui-datepicker-calendar:has(.ui-state-active) td:last-child .ui-state-highlight:not(.ui-state-active) {
    color: #007bff !important;
}

/* 今日リセット時の祝日色を復元 */
.ui-datepicker-calendar:has(.ui-state-active) td.ui-datepicker-holiday .ui-state-highlight:not(.ui-state-active) {
    color: #dc3545 !important;
}

/* ========================================
   カスタムコンボボックス
   ======================================== */

/* ラッパー */
.custom-combobox-wrapper {
    position: relative;
    width: 100%;
}

/* 表示部分 */
.custom-combobox-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    min-height: 38px;
    gap: 8px;
    flex-wrap: wrap;
}

.custom-combobox-display:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* プレースホルダー状態 */
.custom-combobox-display.placeholder .custom-combobox-text {
    color: #999;
}

/* 表示テキスト */
.custom-combobox-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
    color: #333;
}

/* 複数選択モードで非表示にする表示テキスト */
.custom-combobox-text-hidden {
    display: none;
}

/* 矢印 */
.custom-combobox-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.2s;
    color: #666;
    margin-left: auto;
}

.custom-combobox-wrapper.open .custom-combobox-arrow {
    transform: rotate(180deg);
}

/* ドロップダウン */
.custom-combobox-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 200;
}

.custom-combobox-wrapper.open .custom-combobox-dropdown {
    display: block;
}

/* ドロップダウンアイテム */
.custom-combobox-item {
    padding: 10px 12px;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.custom-combobox-item:hover {
    background: #f0f2f5;
}

/* キーボード操作でハイライトされた項目 */
.custom-combobox-item.highlighted {
    background: #e8ecf1;
    font-weight: 600;
}

/* スクロールバーのスタイル */
.custom-combobox-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-combobox-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-combobox-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.custom-combobox-dropdown::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ========================================
   共通メッセージスタイル
   ======================================== */

/* データなしメッセージ */
.no-data-message {
    text-align: center;
    color: #888;
}
