/* profile.css - Profile Page Styles */

/* ========== Profile Page Layout ========== */
.profile-page {
    min-height: calc(100vh - 200px);
    background: #f8f9fa;
}

.profile-content {
    padding: 40px 0 60px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ========== Profile Cards ========== */
.profile-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.profile-card-header h2 {
    color: var(--accent-dark);
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

/* ========== Profile Picture Section ========== */
.profile-picture-section {
    margin-bottom: 30px;
    text-align: center;
}

.profile-picture-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.profile-picture-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.profile-picture-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-initials {
    color: white;
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
}

.upload-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-upload, .btn-remove {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-upload {
    background: var(--accent);
    color: white;
}

.btn-upload:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-remove {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

.btn-remove:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* ========== Crop Modal ========== */
.crop-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.crop-modal.active {
    display: flex;
}

.crop-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--accent);
    color: white;
}

.crop-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.close-crop-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-area {
    padding: 20px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #f8f8f8;
}

.crop-area img {
    max-width: 100%;
    max-height: 400px;
}

.crop-controls {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel, .btn-crop {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-crop {
    background: var(--accent);
    color: white;
}

.btn-crop:hover {
    background: var(--accent-dark);
}

/* ========== Profile Form ========== */
.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;
    gap: 8px;
}

.form-group label {
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(17, 110, 53, 0.1);
}

.form-group input[readonly] {
    background: #f8f8f8;
    color: #666;
    cursor: not-allowed;
}

.field-note {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #666;
}

.char-count.warning {
    color: #e74c3c;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* ========== Verification Section ========== */
.verification-card {
    border-left: 4px solid var(--accent);
}

.verification-badge {
    background: #f0f9f0;
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.verification-badge.verified {
    background: #d4edda;
    color: #155724;
}

.verification-badge.not-verified {
    background: #fff3cd;
    color: #856404;
}

.verification-status {
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
}

.verification-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.verification-icon {
    color: var(--accent);
    margin-bottom: 10px;
}

.verification-text h3 {
    color: var(--accent-dark);
    margin: 0 0 10px 0;
    font-size: 1.25rem;
}

.verification-text p {
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.verification-benefits {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    text-align: left;
    max-width: 400px;
}

.benefit {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-size: 14px;
}

.benefit svg {
    fill: var(--accent);
    flex-shrink: 0;
}

.btn-verify {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-verify:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 110, 53, 0.3);
}

.btn-verify:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.verification-note {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

/* ========== Account Settings ========== */
.account-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.account-action-btn:hover {
    background: #f8f8f8;
    border-color: var(--accent);
    transform: translateX(4px);
}

.account-action-btn svg {
    fill: var(--accent);
    flex-shrink: 0;
}

.logout-btn {
    color: #e74c3c;
    border-color: #fdeaea;
}

.logout-btn:hover {
    background: #fdeaea;
    border-color: #e74c3c;
}

.logout-btn svg {
    fill: #e74c3c;
}

/* ========== My Listings ========== */
.listings-count {
    background: #f0f9f0;
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.listings-container {
    min-height: 200px;
}

.empty-listings {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.empty-listings svg {
    fill: #ddd;
    margin-bottom: 20px;
}

.empty-listings p {
    margin: 0 0 20px 0;
    font-size: 16px;
}

.btn-upload-listing {
    background: var(--accent);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-upload-listing:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

/* Listing items within the profile */
.listing-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.listing-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.listing-image {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-details {
    flex: 1;
}

.listing-title {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 5px 0;
}

.listing-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

.listing-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.listing-status.approved {
    background: #d4edda;
    color: #155724;
}

.listing-status.pending {
    background: #fff3cd;
    color: #856404;
}

.listing-status.draft {
    background: #e2e3e5;
    color: #383d41;
}

/* ========== Notification Toast ========== */
.notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    animation: slideInUp 0.3s ease;
    max-width: 300px;
}

.notification-toast.show {
    display: block;
}

.notification-toast.error {
    background: #e74c3c;
}

.notification-toast.success {
    background: #116e35;
}

.notification-toast.info {
    background: #3498db;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========== Modal Styles ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--accent);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1100px) {
    .profile-grid {
        grid-template-columns: 1fr;
        max-width: 800px;
    }
    
    .profile-column {
        max-width: 100%;
    }
}

@media (max-width: 860px) {
    .profile-content {
        padding: 30px 0 40px;
    }
    
    .profile-card {
        padding: 25px 20px;
        margin: 0 -16px;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .profile-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .profile-grid {
        gap: 0;
    }
    
    .profile-column {
        gap: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .profile-picture-preview {
        width: 120px;
        height: 120px;
    }
    
    .profile-initials {
        font-size: 2.5rem;
    }
    
    .verification-benefits {
        max-width: 100%;
    }
    
    .crop-area {
        min-height: 300px;
    }
    
    .crop-area img {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .profile-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .verification-badge {
        align-self: flex-start;
    }
    
    .upload-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-upload, .btn-remove {
        width: 100%;
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    .crop-modal-content {
        max-height: 80vh;
    }
    
    .crop-area {
        min-height: 250px;
    }
    
    .notification-toast {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Profile Picture Loading State */
.profile-picture-preview.loading {
    background: #f0f0f0;
}

.profile-picture-preview.loading img {
    display: none;
}

.profile-picture-preview.loading .profile-initials {
    display: none;
}