/**
 * Friends Native View Styles
 */

.friends-native-wrapper {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --error: #ef4444;
    --warning: #fbbf24;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --border-color: #475569;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;

    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--background);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.friends-native {
    flex: 1;
    color: var(--text);
}

/* Container Layout */
.friends-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
    padding: 2rem;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.friends-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-count {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

.sidebar-empty {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem 0;
}

/* Request Items in Sidebar */
.request-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.request-item:last-child {
    margin-bottom: 0;
}

.request-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.btn-accept {
    background: var(--success);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-accept:hover {
    background: #059669;
}

.btn-decline {
    background: var(--error);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-decline:hover {
    background: #dc2626;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* Tab Content */
.tab-content {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 400px;
}

/* Friend Avatar */
.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.friend-name {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Friends Grid */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.friend-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.2s;
}

.friend-card:hover {
    border-color: var(--primary);
}

.friend-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.friend-card-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.friend-card-since {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.friend-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-dm {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-dm:hover {
    background: var(--primary-dark);
}

.btn-remove {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: var(--error);
    color: white;
}

/* Search Box */
.search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-search:hover {
    background: var(--primary-dark);
}

/* Search Results */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-add-friend {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-friend:hover {
    background: #059669;
}

.btn-add-friend:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* DM List */
.dm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.dm-item:hover {
    border-color: var(--primary);
}

.dm-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading-spinner {
    text-align: center;
    padding: 4rem;
    color: var(--text-secondary);
}

/* Mobile */
@media (max-width: 900px) {
    .friends-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .friends-sidebar {
        order: 2;
    }

    .main-content {
        order: 1;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 auto;
        min-width: 100px;
    }

    .friends-grid {
        grid-template-columns: 1fr;
    }

    .friend-card-actions {
        flex-direction: column;
    }
}
