/* フレンド一覧画面専用スタイル */

/* ヘッダーの検索ボタン */
.search-btn {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    color: white;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

/* フレンド数表示 */
.friends-count-header {
    padding: 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.friends-total {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* フレンドリスト */
.friends-list {
    padding: 0;
}

.friend-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.friend-item:hover {
    background-color: #f8f9fa;
}

.friend-item:active {
    background-color: #e9ecef;
}

.friend-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #2196F3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-right: 12px;
    flex-shrink: 0;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.friend-badge {
    font-size: 14px;
    display: inline-block;
}

.friend-title {
    font-size: 12px;
    color: #999;
    margin: 0 0 2px 0;
    font-style: italic;
}

.friend-status {
    font-size: 14px;
    color: #666;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-btn {
    background: none;
    border: none;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.action-btn:hover {
    background-color: #f5f5f5;
    transform: scale(1.1);
}

.action-btn:active {
    transform: scale(0.95);
}

/* アバターのフレームスタイル */
.friend-avatar {
    position: relative;
}

/* ゴールドフレーム */
.friend-avatar.avatar-frame-gold {
    border: 3px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* レインボーフレーム */
.friend-avatar.avatar-frame-rainbow {
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    padding: 3px;
}

.friend-avatar.avatar-frame-rainbow .avatar-text {
    background-color: #2196F3;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* ファイアーフレーム */
.friend-avatar.avatar-frame-fire {
    border: 3px solid #ff4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.6);
}

/* ネイチャーフレーム */
.friend-avatar.avatar-frame-nature {
    border: 3px solid #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
}

/* アバターの背景色バリエーション（フレームなしの場合） */
.friend-item:nth-child(5n) .friend-avatar:not([class*="avatar-frame"]) {
    background-color: #00BCD4;
}

.friend-item:nth-child(6n) .friend-avatar:not([class*="avatar-frame"]) {
    background-color: #FFC107;
}

.friend-item:nth-child(7n) .friend-avatar:not([class*="avatar-frame"]) {
    background-color: #795548;
}

.friend-item:nth-child(8n) .friend-avatar:not([class*="avatar-frame"]) {
    background-color: #E91E63;
}

.friend-item:nth-child(9n) .friend-avatar:not([class*="avatar-frame"]) {
    background-color: #9C27B0;
}

.friend-item:nth-child(10n) .friend-avatar:not([class*="avatar-frame"]) {
    background-color: #3F51B5;
}

/* 検索UI */
.search-overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    height: 100vh;
    background-color: white;
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease;
}

.search-overlay.active {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
    }
    to {
        transform: translateX(-50%) translateY(0);
    }
}

.search-header {
    background-color: #2196F3;
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.search-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.search-input-wrapper {
    position: relative;
    padding: 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    background-color: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-icon {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #999;
}

.search-results {
    overflow-y: auto;
    height: calc(100vh - 140px);
    background-color: white;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:active {
    background-color: #e9ecef;
}

.search-result-item .friend-avatar {
    width: 45px;
    height: 45px;
    font-size: 18px;
}

.search-result-item .friend-info {
    flex: 1;
    min-width: 0;
    margin: 0 12px;
}

.search-result-item .friend-name {
    font-size: 15px;
    margin-bottom: 2px;
}

.search-result-item .friend-title {
    font-size: 12px;
    color: #999;
    margin: 0 0 2px 0;
}

/* レスポンシブ対応 */
@media (max-width: 430px) {
    .friend-item {
        padding: 12px 16px;
    }
    
    .friend-avatar {
        width: 45px;
        height: 45px;
        font-size: 18px;
        margin-right: 10px;
    }
    
    .friend-name {
        font-size: 15px;
    }
    
    .friend-status {
        font-size: 13px;
    }
}