/**
 * Friends Module Styles
 *
 * @package IncuCommunity
 * @since 1.0.0
 */

/* CSS Variables */
:root {
    --incuc-friends-bg: #fff;
    --incuc-friends-border: #e5e7eb;
    --incuc-friends-primary: #3b82f6;
    --incuc-friends-primary-hover: #2563eb;
    --incuc-friends-success: #10b981;
    --incuc-friends-danger: #ef4444;
    --incuc-friends-text: #1f2937;
    --incuc-friends-text-muted: #6b7280;
    --incuc-friends-radius: 12px;
    --incuc-friends-radius-sm: 8px;
    --incuc-friends-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --incuc-friends-shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --incuc-friends-online: #10b981;
}

/* Container */
.incuc-friends-list,
.incuc-friend-requests {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
.incuc-friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.incuc-friends-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--incuc-friends-text);
}

.incuc-friends-search {
    flex: 1;
    max-width: 300px;
}

.incuc-friends-search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--incuc-friends-border);
    border-radius: var(--incuc-friends-radius);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.incuc-friends-search-input:focus {
    outline: none;
    border-color: var(--incuc-friends-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Grid Layout */
.incuc-friends-grid {
    display: grid;
    gap: 16px;
}

.incuc-friends-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.incuc-friends-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.incuc-friends-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* List Layout */
.incuc-friends-grid.layout-list {
    grid-template-columns: 1fr;
}

.incuc-friends-grid.layout-list .incuc-friend-card {
    flex-direction: row;
    text-align: left;
    padding: 16px;
}

.incuc-friends-grid.layout-list .incuc-friend-avatar {
    width: 56px;
    height: 56px;
    margin: 0 16px 0 0;
}

.incuc-friends-grid.layout-list .incuc-friend-info {
    flex: 1;
}

.incuc-friends-grid.layout-list .incuc-friend-actions {
    margin-top: 0;
}

/* Friend Card */
.incuc-friend-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    background: var(--incuc-friends-bg);
    border: 1px solid var(--incuc-friends-border);
    border-radius: var(--incuc-friends-radius);
    transition: transform 0.2s, box-shadow 0.2s;
}

.incuc-friend-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--incuc-friends-shadow-lg);
}

/* Avatar */
.incuc-friend-avatar-link {
    text-decoration: none;
}

.incuc-friend-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 12px;
}

.incuc-friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.incuc-online-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: var(--incuc-friends-online);
    border: 2px solid var(--incuc-friends-bg);
    border-radius: 50%;
}

/* Friend Info */
.incuc-friend-info {
    margin-bottom: 12px;
}

.incuc-friend-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--incuc-friends-text);
    text-decoration: none;
    margin-bottom: 4px;
}

.incuc-friend-name:hover {
    color: var(--incuc-friends-primary);
}

.incuc-friend-mutual {
    display: block;
    font-size: 13px;
    color: var(--incuc-friends-text-muted);
}

/* Friend Actions */
.incuc-friend-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

/* Buttons */
.incuc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--incuc-friends-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.incuc-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.incuc-btn-icon {
    padding: 8px;
}

.incuc-btn-primary {
    background: var(--incuc-friends-primary);
    color: #fff;
}

.incuc-btn-primary:hover {
    background: var(--incuc-friends-primary-hover);
}

.incuc-btn-secondary {
    background: #f3f4f6;
    color: var(--incuc-friends-text);
}

.incuc-btn-secondary:hover {
    background: #e5e7eb;
}

.incuc-btn-danger {
    background: transparent;
    color: var(--incuc-friends-danger);
}

.incuc-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.incuc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty State */
.incuc-friends-empty,
.incuc-requests-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    background: #f9fafb;
    border-radius: var(--incuc-friends-radius);
}

.incuc-friends-empty-icon,
.incuc-requests-empty-icon {
    color: var(--incuc-friends-text-muted);
    margin-bottom: 16px;
}

.incuc-friends-empty h3,
.incuc-requests-empty h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--incuc-friends-text);
    margin: 0 0 8px;
}

.incuc-friends-empty p,
.incuc-requests-empty p {
    color: var(--incuc-friends-text-muted);
    margin: 0 0 16px;
}

/* Pagination */
.incuc-friends-pagination,
.incuc-requests-pagination {
    text-align: center;
    margin-top: 24px;
}

/* Login Required */
.incuc-friends-login-required,
.incuc-requests-login-required {
    text-align: center;
    padding: 48px 24px;
    background: #f9fafb;
    border-radius: var(--incuc-friends-radius);
}

/* Friend Requests */
.incuc-requests-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--incuc-friends-border);
    padding-bottom: 12px;
}

.incuc-requests-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--incuc-friends-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--incuc-friends-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.incuc-requests-tab:hover {
    background: #f3f4f6;
    color: var(--incuc-friends-text);
}

.incuc-requests-tab.active {
    background: var(--incuc-friends-primary);
    color: #fff;
}

.incuc-requests-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.incuc-requests-tab.active .incuc-requests-badge {
    background: rgba(255, 255, 255, 0.2);
}

/* Request List */
.incuc-requests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Request Card */
.incuc-request-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--incuc-friends-bg);
    border: 1px solid var(--incuc-friends-border);
    border-radius: var(--incuc-friends-radius);
    transition: box-shadow 0.2s;
}

.incuc-request-card:hover {
    box-shadow: var(--incuc-friends-shadow);
}

.incuc-request-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
}

.incuc-request-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.incuc-request-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--incuc-friends-text);
    text-decoration: none;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.incuc-request-name:hover {
    color: var(--incuc-friends-primary);
}

.incuc-request-time {
    font-size: 13px;
    color: var(--incuc-friends-text-muted);
}

.incuc-request-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Friend Button (for member cards) */
.incuc-friend-btn {
    position: relative;
}

.incuc-friend-btn[data-status="none"] {
    background: var(--incuc-friends-primary);
    color: #fff;
}

.incuc-friend-btn[data-status="pending_sent"] {
    background: #f3f4f6;
    color: var(--incuc-friends-text-muted);
}

.incuc-friend-btn[data-status="pending_received"] {
    background: var(--incuc-friends-success);
    color: #fff;
}

.incuc-friend-btn[data-status="friends"] {
    background: var(--incuc-friends-success);
    color: #fff;
}

/* Suggestions */
.incuc-friend-suggestions {
    margin-top: 32px;
}

.incuc-friend-suggestions-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--incuc-friends-text);
    margin-bottom: 16px;
}

.incuc-suggestions-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.incuc-suggestion-card {
    flex-shrink: 0;
    width: 160px;
    padding: 16px;
    background: var(--incuc-friends-bg);
    border: 1px solid var(--incuc-friends-border);
    border-radius: var(--incuc-friends-radius);
    text-align: center;
}

.incuc-suggestion-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
}

.incuc-suggestion-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.incuc-suggestion-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--incuc-friends-text);
    text-decoration: none;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.incuc-suggestion-mutual {
    font-size: 12px;
    color: var(--incuc-friends-text-muted);
    margin-bottom: 12px;
}

/* Loading State */
.incuc-friends-loading,
.incuc-requests-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--incuc-friends-text-muted);
}

.incuc-friends-loading::after,
.incuc-requests-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    margin-left: 12px;
    border: 2px solid var(--incuc-friends-border);
    border-top-color: var(--incuc-friends-primary);
    border-radius: 50%;
    animation: incuc-spin 0.8s linear infinite;
}

@keyframes incuc-spin {
    to { transform: rotate(360deg); }
}

/* Notifications */
.incuc-friends-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--incuc-friends-text);
    color: #fff;
    border-radius: var(--incuc-friends-radius-sm);
    box-shadow: var(--incuc-friends-shadow-lg);
    z-index: 9999;
    animation: incuc-slide-in 0.3s ease;
}

.incuc-friends-notice.success {
    background: var(--incuc-friends-success);
}

.incuc-friends-notice.error {
    background: var(--incuc-friends-danger);
}

@keyframes incuc-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .incuc-friends-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .incuc-friends-header {
        flex-direction: column;
        align-items: stretch;
    }

    .incuc-friends-search {
        max-width: none;
    }

    .incuc-friends-grid.columns-3,
    .incuc-friends-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .incuc-request-card {
        flex-wrap: wrap;
    }

    .incuc-request-info {
        flex: 1 1 calc(100% - 72px);
    }

    .incuc-request-actions {
        flex: 1 1 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .incuc-friends-grid.columns-2,
    .incuc-friends-grid.columns-3,
    .incuc-friends-grid.columns-4 {
        grid-template-columns: 1fr;
    }

    .incuc-friend-card {
        flex-direction: row;
        text-align: left;
        padding: 16px;
    }

    .incuc-friend-avatar {
        width: 56px;
        height: 56px;
        margin: 0 16px 0 0;
    }

    .incuc-friend-info {
        flex: 1;
        margin-bottom: 0;
    }

    .incuc-friend-actions {
        margin-top: 0;
    }

    .incuc-requests-tabs {
        flex-wrap: wrap;
    }

    .incuc-request-actions {
        width: 100%;
    }

    .incuc-request-actions .incuc-btn {
        flex: 1;
    }
}
