/**
 * ファイルダウンロード販売 ユーザー管理機能用CSS
 */

/* ユーザー管理共通スタイル */
.fds-user-management {
    margin: 20px 0;
}

.fds-section-title {
    margin-bottom: 20px;
    font-size: 1.4em;
    color: #23282d;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 10px;
}

/* ユーザー検索フォーム */
.fds-user-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.fds-search-field {
    display: flex;
    flex-grow: 1;
    align-items: center;
    margin-right: 10px;
}

.fds-search-param {
    margin-right: 10px;
    min-width: 150px;
}

.fds-search-input {
    flex-grow: 1;
    min-width: 250px;
}

.fds-user-search-actions {
    display: flex;
    align-items: center;
}

.fds-search-btn {
    margin-right: 10px !important;
}

/* ユーザー一覧テーブル */
.fds-user-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.fds-user-list-table th,
.fds-user-list-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

.fds-user-list-table th {
    background: #f9f9f9;
    font-weight: 600;
}

.fds-user-list-table tbody tr:hover {
    background-color: #f5f5f5;
}

.fds-user-list-table .fds-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

/* ソート可能な列のスタイル */
.fds-sortable {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
    color: #0073aa;
}

.fds-sortable:hover {
    color: #00a0d2;
}

.fds-sortable:after {
    content: "\f345";
    font-family: dashicons;
    font-size: 12px;
    line-height: 1;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

.fds-sortable.asc:after {
    content: "\f343";
    transform: translateY(-50%);
}

.fds-sortable.desc:after {
    content: "\f347";
    transform: translateY(-50%);
}

/* チェックボックス列 */
.fds-column-cb {
    width: 30px;
    text-align: center !important;
}

/* 操作列 */
.fds-column-actions {
    width: 180px;
    text-align: center !important;
}

.fds-action-button {
    padding: 4px 8px !important;
    margin: 0 3px !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
}

/* 一括アクション */
.fds-bulk-action-container {
    display: none;
    margin: 10px 0;
    padding: 10px;
    background: #f7fcfe;
    border: 1px solid #c5dbec;
    border-radius: 3px;
}

.fds-bulk-action-form {
    display: flex;
    align-items: center;
}

.fds-bulk-action-select {
    margin-right: 10px;
    min-width: 200px;
}

.fds-selected-info {
    margin-left: 15px;
    color: #666;
    font-style: italic;
}

/* ページネーション */
.fds-pagination {
    margin: 20px 0;
    text-align: right;
}

.fds-pagination .page-numbers {
    display: inline-block;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #ddd;
    margin: 0 2px;
    text-decoration: none;
}

.fds-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.fds-pagination .page-numbers:hover {
    background: #f5f5f5;
}

.fds-pagination .page-numbers.current:hover {
    background: #0073aa;
}

/* モーダル */
.fds-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.fds-modal-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.fds-modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 0;
    width: 80%;
    max-width: 800px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.fds-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fds-modal-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.fds-modal-close {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #666;
}

.fds-modal-close:hover {
    color: #000;
}

.fds-modal-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.fds-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    text-align: right;
}

/* ユーザー詳細 */
.fds-user-details {
    margin-bottom: 20px;
}

.fds-user-info {
    display: flex;
    margin-bottom: 20px;
}

.fds-user-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin-right: 20px;
}

.fds-user-data {
    flex-grow: 1;
}

.fds-user-name {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

.fds-user-meta {
    margin-bottom: 5px;
    color: #666;
}

.fds-user-meta strong {
    color: #333;
    display: inline-block;
    width: 120px;
}

.fds-user-stats {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.fds-user-stat-box {
    flex: 1 0 200px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    padding: 15px;
    margin: 10px;
    text-align: center;
    border-radius: 3px;
}

.fds-stat-number {
    font-size: 2em;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 5px;
}

.fds-stat-label {
    color: #666;
    font-size: 0.9em;
}

/* メール送信フォーム */
.fds-email-form-container {
    display: none;
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.fds-email-form-title {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.fds-form-field {
    margin-bottom: 15px;
}

.fds-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.fds-form-input {
    width: 100%;
    padding: 8px;
}

.fds-form-textarea {
    width: 100%;
    min-height: 150px;
    padding: 8px;
}

.fds-form-actions {
    margin-top: 20px;
    text-align: right;
}

.fds-form-button {
    margin-left: 10px !important;
}

/* ローディング表示 */
.fds-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.fds-user-list-loading {
    display: none;
    text-align: center;
    margin: 20px 0;
    color: #666;
}

/* エラーメッセージ */
.fds-error {
    padding: 15px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
    margin-bottom: 20px;
}

/* 成功メッセージ */
.fds-success {
    padding: 15px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 3px;
    margin-bottom: 20px;
}

/* 統計情報セクション */
.fds-stats-container {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 20px;
}

.fds-stat-card {
    flex: 1 0 200px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin: 10px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.fds-stat-card.new-users {
    border-left-color: #00a0d2;
}

.fds-stat-card.active-users {
    border-left-color: #46b450;
}

.fds-stat-card.purchases {
    border-left-color: #ffb900;
}

.fds-stat-card.revenue {
    border-left-color: #dc3232;
}

.fds-stat-value {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 5px;
}

.fds-stat-title {
    color: #666;
    font-size: 0.9em;
}

/* レスポンシブ対応 */
@media screen and (max-width: 782px) {
    .fds-user-list-table {
        display: block;
        overflow-x: auto;
    }
    
    .fds-search-field {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 10px;
    }
    
    .fds-search-param,
    .fds-search-input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .fds-user-search-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fds-search-btn {
        margin-bottom: 10px;
    }
    
    .fds-bulk-action-form {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fds-bulk-action-select {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .fds-selected-info {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .fds-modal-content {
        width: 95%;
        margin: 30px auto;
    }
}


/* ユーザー管理画面のパスワード表示ボタンを非表示にするCSS */
.fds-show-password {
    display: none !important;
}

/* パスワード入力欄の幅を調整（ボタンがなくなった分） */
.fds-password-field input[type="password"],
.fds-password-field input[type="text"] {
    width: 100%;
}