/**
 * Friend System Styles
 * 
 * Styles for friend requests, friend lists, and social features
 */

/* Friends Section Container */
.friends-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.friends-section h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Friend Search */
.friend-search {
    position: relative;
    margin-bottom: 25px;
}

.friend-search input[type="text"] {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.friend-search input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.friend-search .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    pointer-events: none;
}

.friend-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #3498db;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.friend-search-results .search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: background 0.2s;
}

.friend-search-results .search-result-item:hover {
    background: #f8f9fa;
}

.friend-search-results .search-result-item:last-child {
    border-bottom: none;
}

.friend-search-results .no-results {
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
}

/* Tabs */
.friends-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.friends-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.friends-tab:hover {
    color: #3498db;
}

.friends-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.friends-tab .badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: bold;
}

.friends-tab-content {
    display: none;
}

.friends-tab-content.active {
    display: block;
}

/* Friend Cards Grid */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.friend-card {
    background: #fff;
    border: 1px solid #ecf0f1;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.friend-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.friend-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.friend-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-name a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}

.friend-name a:hover {
    color: #3498db;
}

.friend-occupation {
    color: #7f8c8d;
    font-size: 13px;
    margin: 0;
}

.friend-location {
    color: #95a5a6;
    font-size: 12px;
    margin: 5px 0 0 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.friend-meta {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    padding: 10px 0;
    border-top: 1px solid #ecf0f1;
}

.friend-meta-item {
    flex: 1;
    text-align: center;
}

.friend-meta-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.friend-meta-label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 2px;
}

.friend-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.friend-btn {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 100px;
}

.friend-btn-primary {
    background: #3498db;
    color: #fff;
}

.friend-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.friend-btn-success {
    background: #27ae60;
    color: #fff;
}

.friend-btn-success:hover {
    background: #229954;
}

.friend-btn-danger {
    background: #e74c3c;
    color: #fff;
}

.friend-btn-danger:hover {
    background: #c0392b;
}

.friend-btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.friend-btn-secondary:hover {
    background: #7f8c8d;
}

.friend-btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #7f8c8d;
}

.friend-btn-outline:hover {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.friend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Friend Suggestions */
.friend-suggestions {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    margin-bottom: 25px;
}

.friend-suggestions h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.friend-suggestions .friends-grid {
    margin-top: 15px;
}

.friend-suggestions .friend-card {
    background: rgba(255, 255, 255, 0.95);
}

/* Friend Request Badge */
.friend-request-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Empty State */
.friends-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.friends-empty-state svg,
.friends-empty-state i {
    font-size: 64px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.friends-empty-state h4 {
    font-size: 20px;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.friends-empty-state p {
    font-size: 15px;
    margin: 0 0 20px 0;
}

/* Friend Counter */
.friends-counter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ecf0f1;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.friends-counter-value {
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
}

.friends-counter-max {
    font-size: 14px;
    color: #7f8c8d;
}

.friends-counter-bar {
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.friends-counter-progress {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #9b59b6);
    transition: width 0.3s ease;
}

/* Loading Spinner */
.friends-loading {
    text-align: center;
    padding: 40px;
}

.friends-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: friends-spin 0.8s linear infinite;
}

@keyframes friends-spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.friend-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.friend-message-success {
    background: #d5f4e6;
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.friend-message-error {
    background: #fadbd8;
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

.friend-message-info {
    background: #d6eaf8;
    color: #3498db;
    border-left: 4px solid #3498db;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mutual Friends Indicator */
.mutual-friends {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 8px;
}

.mutual-friends-count {
    color: #3498db;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .friends-grid {
        grid-template-columns: 1fr;
    }
    
    .friends-tabs {
        flex-wrap: wrap;
    }
    
    .friends-tab {
        flex: 1;
        min-width: 100px;
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .friend-actions {
        flex-direction: column;
    }
    
    .friend-btn {
        width: 100%;
    }
    
    .friends-section {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .friend-card {
        padding: 15px;
    }
    
    .friend-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .friend-name {
        font-size: 14px;
    }
    
    .friend-occupation,
    .friend-location {
        font-size: 12px;
    }
}
