/* Profile page styles */

/* Profile Header */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-6);
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.profile-avatar-container {
    position: relative;
    margin-bottom: var(--space-4);
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.avatar-edit input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.profile-details h2 {
    margin-bottom: var(--space-1);
    font-size: var(--text-2xl);
}

.profile-details p {
    color: var(--text-medium);
    margin-bottom: var(--space-4);
}

.profile-stats {
    display: flex;
    gap: var(--space-6);
    justify-content: center;
    margin-top: var(--space-4);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-dark);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-medium);
}

/* Tabs Navigation */
.profile-tab-container {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.profile-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.tab-btn {
    padding: var(--space-4) var(--space-6);
    background: none;
    border: none;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
    padding: var(--space-6);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Form Styles */
.profile-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    font-size: var(--text-base);
}

.form-group input:disabled {
    background-color: var(--bg-light);
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: var(--space-1);
    color: var(--text-light);
    font-size: var(--text-xs);
}

.help-text {
    margin-bottom: var(--space-4);
    color: var(--text-medium);
    font-size: var(--text-sm);
}

/* Content Sections */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.content-tabs {
    display: flex;
    gap: var(--space-2);
}

.content-tab {
    background-color: var(--bg-light);
    border: none;
    border-radius: var(--radius);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    cursor: pointer;
}

.content-tab.active {
    background-color: var(--primary-color);
    color: white;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.content-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.user-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.content-card {
    background-color: var(--bg-light);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.content-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
}

.content-card-header h4 {
    margin: 0;
    font-size: var(--text-base);
}

.status-badge {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
}

.status-badge.pending {
    background-color: var(--warning-light);
    color: var(--warning);
}

.status-badge.private {
    background-color: var(--bg-light);
    color: var(--text-medium);
}

.status-badge.public {
    background-color: var(--success-light);
    color: var(--success);
}

.content-card-body {
    padding: var(--space-4);
}

.content-card-body p {
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-medium);
}

.content-meta {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--text-light);
}

.content-card-actions {
    display: flex;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-light);
    gap: var(--space-2);
    background-color: var(--bg-white);
}

/* Danger Zone */
.danger-zone {
    background-color: var(--error-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.danger-zone h3 {
    color: var(--error);
    margin-bottom: var(--space-2);
}

.danger-zone p {
    margin-bottom: var(--space-4);
    color: var(--text-medium);
}

.danger-btn {
    background-color: var(--error);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.danger-btn:hover {
    background-color: var(--error-dark);
}

/* Small Button Variant */
.btn-sm {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
}

/* Image Upload Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-white);
    margin: 10% auto;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    width: 80%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    font-size: var(--text-xl);
    cursor: pointer;
}

.image-preview-container {
    width: 100%;
    height: 300px;
    margin: var(--space-4) 0;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    overflow: hidden;
}

#image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-controls {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* Loading/Empty States */
.loading-container, .no-access-message, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    text-align: center;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-4);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state i, .no-access-message i {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: var(--space-4);
}

.loading-spinner {
    text-align: center;
    color: var(--text-medium);
    padding: var(--space-8);
}

.loading-spinner i {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

/* Error message styling */
.error-message {
    background-color: var(--error-light);
    color: var(--error);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    text-align: center;
    margin: var(--space-8) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.error-message i {
    font-size: 48px;
    margin-bottom: var(--space-4);
}

.error-message h3 {
    margin-bottom: var(--space-3);
    font-size: var(--text-xl);
}

.error-message p {
    margin-bottom: var(--space-5);
    color: var(--text-dark);
}

.error-message button {
    margin-top: var(--space-2);
}

/* Language Notification */
.language-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s forwards;
    z-index: 1000;
}

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

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideOut {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .profile-header {
        flex-direction: row;
        text-align: left;
    }
    
    .profile-avatar-container {
        margin-right: var(--space-6);
        margin-bottom: 0;
    }
    
    .profile-stats {
        justify-content: flex-start;
        margin-top: var(--space-2);
    }
}

@media (max-width: 768px) {
    .tab-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content-actions {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .user-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        gap: var(--space-4);
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

/* Profile Photo Preview Styles */
.photo-preview, 
.profile-photo-preview,
#photo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #f1f5f9;
    border: 2px solid #e2e8f0;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.photo-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Style for when image is previewed */
.has-preview {
    background-size: cover;
    background-position: center;
}

.hidden-file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.help-text {
    font-size: var(--text-xs);
    color: var(--text-medium);
}
.profile-photo-preview.has-preview .placeholder-text {
    display: none;
}

.photo-upload-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.hidden-file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.help-text {
    font-size: var(--text-xs);
    color: var(--text-medium);
}
