/* Friends & AI System Styles */
/* css/friends-ai-styles.css */

.friends-ai-system {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 24px;
    margin: 20px 0;
}

.friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 24px;
}

.friends-header h2 {
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

.ai-assistant-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.ai-assistant-indicator.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ai-avatar {
    font-size: 18px;
    animation: pulse 2s infinite;
}

.ai-name {
    font-weight: 600;
    font-size: 14px;
}

.ai-status {
    font-size: 12px;
    opacity: 0.9;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Status Control Section */
.status-control {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    border: 1px solid #dee2e6;
}

.status-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    margin: 0 8px;
    font-size: 14px;
    min-width: 140px;
}

.status-message-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.status-message-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* AI Settings Panel */
.ai-settings-panel {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    border: 1px solid #667eea30;
}

.ai-settings-panel h3 {
    color: #2c3e50;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-controls {
    display: grid;
    gap: 16px;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
}

.ai-setting-toggle:checked + .toggle-slider {
    background: #667eea;
}

.ai-setting-toggle:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.ai-level-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-level-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 160px;
}

.ai-permissions h4 {
    margin: 16px 0 12px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

/* Friends Section */
.friends-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    color: #2c3e50;
    margin: 0;
}

.friends-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Friends List */
.friends-list {
    display: grid;
    gap: 12px;
}

.friend-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.friend-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.friend-item.online {
    border-left: 4px solid #28a745;
}

.friend-item.away {
    border-left: 4px solid #ffc107;
}

.friend-item.busy {
    border-left: 4px solid #dc3545;
}

.friend-item.offline {
    border-left: 4px solid #6c757d;
    opacity: 0.8;
}

.friend-avatar {
    position: relative;
    margin-right: 16px;
}

.friend-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
}

.status-indicator.online {
    background: #28a745;
}

.status-indicator.away {
    background: #ffc107;
}

.status-indicator.busy {
    background: #dc3545;
}

.status-indicator.offline {
    background: #6c757d;
}

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

.friend-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.verified-badge {
    color: #28a745;
    font-size: 14px;
}

.friend-status {
    color: #6c757d;
    font-size: 14px;
    margin: 4px 0;
}

.friend-activity {
    color: #9ca3af;
    font-size: 13px;
}

.friend-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-friend-status {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
}

.ai-permission-indicator {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.ai-permission-indicator.enabled {
    background: #667eea20;
    color: #667eea;
}

.ai-permission-indicator.disabled {
    background: #f0f0f0;
    color: #6c757d;
}

/* No Friends State */
.no-friends {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-friends p {
    font-size: 16px;
    margin-bottom: 16px;
}

/* Friend Requests */
.friend-requests-section h3 {
    color: #2c3e50;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.requests-list {
    display: grid;
    gap: 12px;
}

.request-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.request-item:hover {
    border-color: #667eea;
    background: #667eea10;
}

.request-avatar {
    margin-right: 16px;
}

.request-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

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

.request-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.request-message {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 4px;
}

.request-time {
    color: #9ca3af;
    font-size: 12px;
}

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

.no-requests {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
}

/* AI Suggestions Panel */
.ai-suggestions-panel {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #667eea30;
    margin-top: 24px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-suggestions-panel h3 {
    color: #2c3e50;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestions-list {
    display: grid;
    gap: 12px;
}

.ai-suggestion-item {
    background: white;
    padding: 16px;
    border-radius: 10px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    position: relative;
}

.ai-suggestion-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.suggestion-content {
    margin-bottom: 16px;
}

.suggestion-type {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.suggestion-text {
    color: #2c3e50;
    line-height: 1.5;
    margin-bottom: 8px;
}

.suggestion-confidence {
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 4px;
}

.suggestion-reasoning {
    color: #9ca3af;
    font-size: 12px;
    font-style: italic;
}

.suggestion-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Modal Styles */
.friends-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideInScale 0.3s ease;
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-weight: 600;
}

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

.modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Search Results */
.search-results {
    margin-top: 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.search-results:not(:empty) {
    display: block;
}

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

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

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-username {
    color: #6c757d;
    font-size: 13px;
}

.no-results {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Button Styles */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border-color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .friends-ai-system {
        padding: 16px;
        margin: 10px 0;
    }

    .friends-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .ai-assistant-indicator {
        align-self: center;
    }

    .status-control {
        padding: 16px;
    }

    .friend-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
    }

    .friend-avatar {
        margin: 0 auto 12px auto;
    }

    .friend-info {
        width: 100%;
        text-align: center;
        margin-bottom: 12px;
    }

    .friend-actions,
    .request-actions,
    .suggestion-actions {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .friends-filters {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .friends-ai-system {
        padding: 12px;
    }

    .ai-settings-panel,
    .status-control {
        padding: 12px;
    }

    .friend-item,
    .request-item,
    .ai-suggestion-item {
        padding: 12px;
    }

    .btn-small {
        padding: 4px 8px;
        font-size: 12px;
    }
}
