/* Profile Page Styles */

.profile-container {
    padding: 20px 40px 40px;
    min-height: 100vh;
}

.profile-header {
    margin-bottom: 40px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.profile-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.profile-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 8px;
}

.profile-header p {
    font-size: 16px;
    color: var(--muted-foreground);
}

/* Close Button */
.btn-close {
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: var(--accent);
    color: var(--foreground);
    border-color: var(--accent);
    transform: translateY(-2px);
}


.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    gap: 32px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Profile Card */
.profile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 2);
    overflow: hidden;
}

.profile-card-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.profile-card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--foreground);
}

.profile-card-content {
    padding: 24px;
}

/* Avatar Section */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
}

.avatar-upload-btn svg {
    width: 18px;
    height: 18px;
    color: white;
}

.avatar-upload-btn span {
    display: none;
}

.avatar-info {
    flex: 1;
}

.avatar-hint {
    font-size: 14px;
    color: var(--foreground);
    margin-bottom: 4px;
}

.avatar-size {
    font-size: 12px;
    color: var(--muted-foreground);
}

/* Form Styles */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 14px;
    transition: all 0.2s;
}

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

.form-group input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.field-hint {
    font-size: 12px;
    color: var(--muted-foreground);
    margin-top: 4px;
}

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

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 8px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

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

.btn-secondary {
    background: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--accent);
}

.btn-outline {
    padding: 8px 16px;
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: rgba(102, 126, 234, 0.1);
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    padding: 10px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Security Section */
.security-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.security-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.security-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.security-icon svg {
    color: var(--foreground);
}

.security-info {
    flex: 1;
}

.security-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 4px;
}

.security-info p {
    font-size: 14px;
    color: var(--muted-foreground);
    margin-bottom: 12px;
}

/* Activity Section */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.activity-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: var(--radius);
}

.activity-icon svg {
    color: var(--foreground);
}

.activity-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-label {
    font-size: 14px;
    color: var(--muted-foreground);
}

.activity-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
}

.status-active {
    color: #10b981;
}

/* Danger Zone */
.danger-zone {
    border: 1px solid #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.danger-zone .profile-card-header {
    background: rgba(239, 68, 68, 0.05);
    border-bottom-color: rgba(239, 68, 68, 0.2);
}

.danger-zone .profile-card-header h2 {
    color: #ef4444;
}

.danger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.danger-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 4px;
}

.danger-info p {
    font-size: 14px;
    color: var(--muted-foreground);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-message {
    font-size: 14px;
    color: var(--foreground);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .profile-grid {
        grid-template-columns: 1fr;
        max-width: 900px;
    }
}

@media (max-width: 768px) {
    .profile-container {
        padding: 20px 20px 40px;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }

    .danger-item {
        flex-direction: column;
        text-align: center;
    }

    .security-item {
        flex-direction: column;
        text-align: center;
    }

    .form-actions {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        min-width: 90px;
        padding: 8px 20px;
    }
}

/* API Modal Styles */
.api-models-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.model-info-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.model-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    width: fit-content;
}

.model-info-card strong {
    color: var(--foreground);
    font-size: 0.95rem;
}

.model-info-card small {
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-with-button input {
    flex: 1;
}

.btn-icon {
    padding: 0.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--accent);
    color: var(--foreground);
}

.api-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-label {
    color: var(--muted-foreground);
    font-size: 0.9rem;
}

.status-value {
    color: var(--foreground);
    font-weight: 500;
}

.status-value.connected {
    color: #10b981;
}

.status-value.disconnected {
    color: #ef4444;
}

.test-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.test-result.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.test-result.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.result-content {
    font-size: 0.9rem;
    line-height: 1.5;
}

.api-footer {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-danger-text {
    color: #ef4444;
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-text:hover {
    color: #dc2626;
    text-decoration: underline;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}