/**
 * Console2 Messages CSS
 * メッセージ一覧画面専用のスタイル
 */

/* ========================================
   フィルタータグ
   ======================================== */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* ========================================
   メッセージリスト
   ======================================== */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-item-cover {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    transition: all var(--transition-base);
    overflow: hidden;
}

.message-item {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-primary);


    align-items: start;
}

.message-item-cover:hover {
    border-color: rgba(81, 187, 155, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.message-item.unread {
    padding-left: calc(1.25rem - 12px);
    border-left: 12px solid var(--accent-primary);
    background: rgba(81, 187, 155, 0.03);
}

/* ========================================
   メッセージチェックボックス
   ======================================== */
.message-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    margin-top: 0.25rem;
}

/* ========================================
   メッセージコンテンツ
   ======================================== */
.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.message-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.message-sender {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.message-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.message-date {
    font-size: 0.8125rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.message-body {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.message-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.message-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ========================================
   メッセージアクション
   ======================================== */
.message-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ========================================
   メッセージ詳細モーダル
   ======================================== */
.message-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.message-detail-modal.active {
    display: flex;
}

.message-detail-content {
    background: var(--bg-primary);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.message-detail-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-detail-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.message-detail-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.message-detail-close:hover {
    color: var(--warning-primary);
}

.message-detail-body {
    padding: 1.5rem;
    grid-column-gap: 0px;
    grid-row-gap: 0px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: none;
}

.detail-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.detail-message {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
    line-height: 1.6;
}

#detailDate {
    font-size: 0.8rem;
}

#detailName {
    font-weight: bold;
}

#detailEmail {
    font-size: 0.7rem;
}

#detailEmail::before {
    content: "[ ";
}

#detailEmail::after {
    content: " / ";
}

#detailIP {
    grid-area: 3 / 2 / 4 / 3;
}

#detailIP::after {
    content: " ]";
}

#detailIP {
    font-size: 0.7rem;
}

/* ========================================
   レスポンシブ（メッセージ用）
   ======================================== */
@media (max-width: 768px) {
    .message-item {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }

    .message-actions {
        grid-column: 2;
        flex-direction: row;
        justify-content: flex-start;
    }

    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}