/* assets/css/common.css */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f6fa;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
    
    /* 統一されたボタン色の定義 */
    --btn-create-color: #007bff;     /* 新規作成: 青 */
    --btn-edit-color: #28a745;       /* 編集: 緑 */
    --btn-delete-color: #dc3545;     /* 削除: 赤 */
    --btn-view-color: #17a2b8;       /* 表示・詳細: シアン */
    --btn-action-color: #6f42c1;     /* その他のアクション: 紫 */
    --btn-toggle-color: #fd7e14;     /* 切り替え: オレンジ */
    --btn-email-color: #20c997;      /* メール・通知: ティール */
    --btn-manage-color: #6c757d;     /* 管理: グレー */
    
    /* テーブルヘッダー色 */
    --table-header-color: #f8f9fa;   /* 薄いグレー */
}

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

html {
    overflow-y: hidden;
    height: 100vh;
}

body {
    padding-bottom: 4rem; /* フッターの高さ分を小さく */
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', Meiryo, メイリオ, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

h1,h2,h3,h4,h5,h6 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

p {
    margin-bottom: 0;
}

.container {
    max-width: none;
    margin: 5px auto;
    padding: 0 1rem;
}

.main-nav {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.5rem; /* パディングを小さく */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;  /* 追加 */
    top: 0;          /* 追加 */
    left: 0;         /* 追加 */
    width: 100%;     /* 追加 */
    z-index: 1000;   /* 追加 */
}

/* ナビゲーションユーザー情報 */
.nav-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin: 0 1rem;
}

.user-welcome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.user-welcome i {
    color: var(--primary-color);
}

.current-time {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.8;
    font-weight: 500;
    white-space: nowrap;
}

/* フッター用のスタイルを追加 */
.main-footer {
    background: white;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    padding: 0.5rem; /* パディングを小さく */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: color 0.3s;
    line-height: 1.2;
    min-height: 2rem;
    padding: 0.25rem 0.5rem;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* ログアウトリンクのスタイル */
.nav-links .logout-link {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white !important;
    padding: 0.5rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 65, 108, 0.3);
}

.nav-links .logout-link:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #dd2c00 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 65, 108, 0.4);
    color: white !important;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn {
    padding: 0.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

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

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

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

/* 統一されたボタンスタイル */
.btn-create {
    background-color: var(--btn-create-color);
    color: white;
    border: none;
}

.btn-create:hover {
    background-color: #0056b3;
    color: white;
}

.btn-edit {
    background-color: var(--btn-edit-color);
    color: white;
    border: none;
}

.btn-edit:hover {
    background-color: #1e7e34;
    color: white;
}

.btn-delete {
    background-color: var(--btn-delete-color);
    color: white;
    border: none;
}

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

.btn-view {
    background-color: var(--btn-view-color);
    color: white;
    border: none;
}

.btn-view:hover {
    background-color: #138496;
    color: white;
}

.btn-action {
    background-color: var(--btn-action-color);
    color: white;
    border: none;
}

.btn-action:hover {
    background-color: #5a32a3;
    color: white;
}

.btn-toggle {
    background-color: var(--btn-toggle-color);
    color: white;
    border: none;
}

.btn-toggle:hover {
    background-color: #e55a00;
    color: white;
}

.btn-email {
    background-color: var(--btn-email-color);
    color: white;
    border: none;
}

.btn-email:hover {
    background-color: #1aa085;
    color: white;
}

.btn-manage {
    background-color: var(--btn-manage-color);
    color: white;
    border: none;
}

.btn-manage:hover {
    background-color: #545b62;
    color: white;
}

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

.btn-secondary:hover {
    background-color: #545b62;
    color: white;
}

/* assets/css/common.css に追加 */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ドロップダウンメニューのスタイル */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    line-height: 1.2;
    min-height: 2rem;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
}

/* ナビゲーションのアイコンサイズを統一 */
.nav-links i {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
}

/* ナビゲーションドロップダウンの色分け - アイコンのみ対応 */
.dropdown-toggle.communication-nav {
    color: #4285f4 !important;
    padding: 0.5rem !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.dropdown-toggle.pickup-nav {
    color: #34a853 !important;
    padding: 0.5rem !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.dropdown-toggle.management-nav {
    color: #ff9800 !important;
    padding: 0.5rem !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.dropdown-toggle.system-nav {
    color: #9c27b0 !important;
    padding: 0.5rem !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

/* ドロップダウンアローの調整 */
.dropdown-toggle .dropdown-arrow {
    position: absolute !important;
    bottom: -2px !important;
    right: -2px !important;
    font-size: 0.6rem !important;
    background: white !important;
    border-radius: 50% !important;
    width: 16px !important;
    height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}

/* ドロップダウンメニューのホバー効果 */
.dropdown-toggle.communication-nav:hover {
    background-color: rgba(66, 133, 244, 0.1) !important;
    transform: scale(1.05) !important;
}

.dropdown-toggle.pickup-nav:hover {
    background-color: rgba(52, 168, 83, 0.1) !important;
    transform: scale(1.05) !important;
}

.dropdown-toggle.management-nav:hover {
    background-color: rgba(255, 152, 0, 0.1) !important;
    transform: scale(1.05) !important;
}

.dropdown-toggle.system-nav:hover {
    background-color: rgba(156, 39, 176, 0.1) !important;
    transform: scale(1.05) !important;
}

/* ナビゲーションリンクの間隔調整 */
.nav-links {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-dropdown {
    position: relative !important;
}

/* アイコンのみ表示時のメインアイコンサイズ調整 */
.dropdown-toggle i:first-child {
    font-size: 1.2rem !important;
}


/* 管理者限定・マスター限定のスタイル */
.dropdown-menu li a.admin-only {
    color: #9b59b6 !important;
    font-style: italic;
}

.dropdown-menu li a.master-only {
    color: #e74c3c !important;
    font-weight: 600;
}

.dropdown-menu li a.admin-only:hover {
    background-color: rgba(155, 89, 182, 0.1) !important;
}

.dropdown-menu li a.master-only:hover {
    background-color: rgba(231, 76, 60, 0.1) !important;
}

.nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    /* left: 0 !important; */
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    padding: 0.5rem 0 !important;
    list-style: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 9999 !important;
    border: 1px solid var(--border-color) !important;
    display: none !important;
    white-space: nowrap !important;
}

.nav-dropdown.active .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.nav-dropdown .dropdown-menu li {
    margin: 0 !important;
}

.nav-dropdown .dropdown-menu a {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    color: var(--text-color) !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease !important;
    border-radius: 0 !important;
}

.nav-dropdown .dropdown-menu a:hover {
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
}

.nav-dropdown .dropdown-menu i {
    width: 16px !important;
    text-align: center !important;
    color: var(--primary-color) !important;
}

/* ドロップダウンメニューの区切り線 */
.nav-dropdown .dropdown-menu .dropdown-divider {
    height: 1px !important;
    background-color: var(--border-color) !important;
    margin: 0.5rem 0 !important;
    border: none !important;
}

/* マスター専用項目のスタイル */
.nav-dropdown .dropdown-menu .master-only {
    background-color: rgba(231, 76, 60, 0.05) !important;
    border-left: 3px solid #e74c3c !important;
}

.nav-dropdown .dropdown-menu .master-only:hover {
    background-color: rgba(231, 76, 60, 0.1) !important;
}

.nav-dropdown .dropdown-menu .master-only i {
    color: #e74c3c !important;
}

/* 管理者専用項目のスタイル */
.nav-dropdown .dropdown-menu .admin-only {
    background-color: rgba(155, 89, 182, 0.05) !important;
    border-left: 3px solid #9b59b6 !important;
}

.nav-dropdown .dropdown-menu .admin-only:hover {
    background-color: rgba(155, 89, 182, 0.1) !important;
}

.nav-dropdown .dropdown-menu .admin-only i {
    color: #9b59b6 !important;
}

/* モバイル表示用のナビゲーションアクション（デスクトップでは非表示） */
.mobile-nav-actions {
    display: none;
}

/* モバイルメニューボタン */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    position: relative;
}

.mobile-menu-toggle:hover {
    background-color: var(--secondary-color);
}

/* デスクトップとモバイルでのアイコン表示制御 */
.mobile-menu-toggle .desktop-icon {
    display: inline-block;
}

.mobile-menu-toggle .mobile-icon {
    display: none;
}

/* レスポンシブデザイン用 */
@media screen and (max-width: 768px) {
    /* モバイル表示用のナビゲーションアクション */
    .mobile-nav-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .mobile-menu-toggle {
        display: block;
        padding: 0;
    }
    
    /* スマホではログアウトアイコンを表示 */
    .mobile-menu-toggle .desktop-icon {
        display: none;
    }
    
    .mobile-menu-toggle .mobile-icon {
        display: inline-block;
        color: var(--danger-color);
    }

    .nav-links {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-top: 1px solid var(--border-color);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 1000;
    }

    .nav-links.active {
        max-height: 500px;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links > li > a {
        padding: 1rem;
        justify-content: space-between;
        font-weight: 500;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
        background-color: #f8f9fa;
        padding: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-dropdown.active .dropdown-menu {
        max-height: 300px;
    }

    .dropdown-menu a {
        padding: 0.75rem 2rem;
        border-bottom: 1px solid #e9ecef;
        font-size: 0.9rem;
    }

    .dropdown-menu a:last-child {
        border-bottom: none;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

    .main-nav {
        padding: 0.5rem;
        flex-wrap: wrap;
    }

    .nav-user-info {
        order: 1;
        width: 100%;
        margin: 0.5rem 0 0 0;
        flex-direction: row;
        justify-content: center;
    }

    .user-welcome {
        font-size: 0.85rem;
    }

    .current-time {
        font-size: 0.7rem;
    }
}

@media screen and (max-width: 480px) {
    .nav-user-info {
        display: none;
    }
}

/* Toastr カスタムスタイル */
.toast-top-right {
    top: 80px !important;
    right: 12px !important;
}

.toast {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    font-family: 'Noto Sans JP', sans-serif !important;
    font-size: 14px !important;
}

.toast-success {
    background-color: var(--success-color) !important;
}

.toast-error {
    background-color: var(--danger-color) !important;
}

.toast-warning {
    background-color: #f39c12 !important;
}

.toast-info {
    background-color: var(--primary-color) !important;
}

.toast-message {
    font-weight: 500 !important;
}

.toast-progress {
    height: 3px !important;
}

/* アラート表示 */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    max-width: 400px;
    animation: alertSlideIn 0.3s ease-out;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background: #cce7ff;
    color: #004085;
    border-left: 4px solid #007bff;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    margin-left: auto;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes alertSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* モーダル統一スタイル */
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
    border-radius: 2px;
}

.modal-close:hover,
.modal-close:focus {
    opacity: 1;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
}

.modal-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.modal-close:active {
    background: rgba(255, 255, 255, 0.2);
}

/* 危険なモーダルヘッダー内のクローズボタン */
.modal-header.bg-danger .modal-close {
    color: #ffffff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

/* 通常のモーダルヘッダー内のクローズボタン */
.modal-header:not(.bg-danger) .modal-close {
    color: #000000;
    text-shadow: none;
}

/* モーダルフッターの統一スタイル */
.modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 0.375rem 0.375rem;
}

.modal .modal-footer .btn {
    margin: 0;
    min-width: 120px;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    height: auto;
    line-height: 1.5;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* form-actions内のボタンスタイル（新規登録・編集モーダル用） */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    margin-top: 1.5rem;
}

.form-actions .btn {
    margin: 0;
    min-width: 120px;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    height: auto;
    line-height: 1.5;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
