/**
 * ユーザードロップダウン統一スタイル
 * すべてのページで一貫したドロップダウンUI
 */

/* ユーザープロファイル */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: rgba(74, 144, 226, 0.08);
}

.user-profile.active {
    background: rgba(74, 144, 226, 0.12);
}

/* DISABLED: .user-profile .user-avatar { */
/* DISABLED:     width: 32px; */
/* DISABLED:     height: 32px; */
/* DISABLED:     border-radius: 50%; */
/* DISABLED:     object-fit: cover; */
/* DISABLED:     border: 2px solid #e0e0e0; */
/* DISABLED: } */

.user-profile .user-name {
    font-weight: 500;
    color: #333;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile .fa-chevron-down {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.user-profile.active .fa-chevron-down {
    transform: rotate(180deg);
}

/* ユーザードロップダウンメニュー */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

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

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.user-dropdown a:hover {
    background: #f8f9fa;
    color: #4a90e2;
}

.user-dropdown a i {
    width: 20px;
    text-align: center;
    color: #666;
}

.user-dropdown a:hover i {
    color: #4a90e2;
}

/* 通知ドロップダウン */
.notification-wrapper {
    position: relative;
}

.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

.notification-wrapper.active .notification-btn {
    background: #4a90e2;
    color: white;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* 通知ドロップダウンパネル */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-height: 480px;
    display: flex;
    flex-direction: column;
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.mark-all-read {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #4a90e2;
    color: #4a90e2;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mark-all-read:hover {
    background: #4a90e2;
    color: white;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.event {
    background: #e3f2fd;
    color: #2196f3;
}

.notification-icon.message {
    background: #f3e5f5;
    color: #9c27b0;
}

.notification-icon.match {
    background: #e8f5e9;
    color: #4caf50;
}

.notification-icon.system {
    background: #fff3e0;
    color: #ff9800;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    font-size: 12px;
    color: #999;
}

.empty-notifications {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.empty-notifications i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-notifications p {
    margin: 0;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .user-dropdown,
    .notification-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 70vh;
    }
    
    .user-dropdown.active,
    .notification-dropdown.active {
        transform: translateY(0);
    }
    
    .user-profile .user-name {
        display: none;
    }
    
    .user-profile .fa-chevron-down {
        display: none;
    }
}

/* z-index調整 */
.user-dropdown,
.notification-dropdown {
    z-index: 9999;
}

/* アニメーション */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown.active,
.notification-dropdown.active {
    animation: dropdownFadeIn 0.3s ease forwards;
}