/* Profile Page Specific Styles */

/* Profile Header Section */
.profile-header {
    background-color: #c1e4e9;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.profile-picture-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #4a90e2;
}

.edit-button {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.edit-button.small {
    width: 10px;
    height: 10px;
}

.username-container {
    display: flex;
    flex-direction: column;
}

.username {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.member-since {
    color: #666;
    font-size: 0.9rem;
    display: flex;
}

/* Profile Navigation Tabs */
.profile-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.profile-tab {
    padding: 0.75rem 1.25rem;
    background-color: #f1f3f5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.profile-tab:hover {
    background-color: #e0e4e8;
}

.profile-tab.active {
    background-color: #4a90e2;
    color: white;
    font-weight: bold;
}

#dark-mode-toggle {
    margin-left: auto;
    padding: 0.75rem 1.25rem;
    background-color: #343a40;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Profile Content Areas */
.profile-content-area {
    background-color: #fff;
    border-radius: 8px;
    padding: 2rem;
    min-height: 400px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.profile-content {
    display: none;
}

.profile-content.active {
    display: block;
}

/* Overview Section */
.highlight {
    color: #4a90e2;
    font-weight: bold;
}

/* My Listings Section */
.my-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-listing {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-listing:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: scale-down;
    margin: auto;
}

.card-listing h3 {
    padding: 0.75rem;
    margin: 0;
    font-size: 1.1rem;
}

.card-description {
    padding: 0 0.75rem;
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    height: 40px;
    overflow: hidden;
}

.card-price {
    padding: 0.75rem;
    margin: 0;
    font-weight: bold;
    color: #333;
}

.listing-actions {
    display: flex;
    padding: 0.75rem;
    gap: 0.5rem;
}

.edit-listing, .remove-listing {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-listing {
    background-color: #4a90e2;
    color: white;
}

.remove-listing {
    background-color: #dc3545;
    color: white;
}

.add-listing-button {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

#edit-listing-form {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#edit-listing-form input,
#edit-listing-form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#edit-listing-form textarea {
    min-height: 100px;
}

/* My Bids Section */
.my-bids-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bid-item {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.bid-image {
    width: 120px;
    flex-shrink: 0;
}

.bid-image img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
}

.bid-details {
    flex: 1;
    padding: 1rem;
}

.bid-details h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.bid-details p {
    margin: 0.25rem 0;
}

.outbid {
    color: #dc3545;
    font-weight: bold;
}

.winning {
    color: #28a745;
    font-weight: bold;
}

.time-remaining {
    color: #666;
    font-style: italic;
}

.bid-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    gap: 0.5rem;
}

.increase-bid-button, .view-auction-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.increase-bid-button {
    background-color: #28a745;
    color: white;
}

.view-auction-button {
    background-color: #6c757d;
    color: white;
}

/* Watchlist Section */
.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.watchlist-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
}

.watchlist-actions {
    display: inline-block;
    padding: 0.75rem;
    gap: 0.5rem;
    margin: auto;
}

.view-card-button, .remove-watch-button {
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.view-card-button {
    background-color: #4a90e2;
    color: white;
}

.remove-watch-button {
    background-color: #dc3545;
    color: white;
}

/* Settings Section */
.profile-settings-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    min-height: 100px;
}

.change-password-button {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.save-settings-button {
    padding: 0.75rem 1.5rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.save-settings-button.small {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.remove-button {
    padding: 0.75rem 1.5rem;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.remove-button.small {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bid-item {
        flex-direction: column;
    }
    
    .bid-image {
        width: 100%;
        height: 200px;
    }
    
    .profile-navigation {
        flex-direction: column;
    }
    
    #dark-mode-toggle {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Search functionality styles */
.search-container {
    display: flex;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

body.dark-mode .search-input {
    background-color: #333;
    border-color: #444;
    color: #e0e0e0;
}

.search-button {
    padding: 0.75rem 1.5rem;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Sort functionality styles */
.sort-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sort-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

body.dark-mode .sort-select {
    background-color: #333;
    border-color: #444;
    color: #e0e0e0;
}

/* Notifications feature styles */
#notifications-btn {
    position: relative;
    padding-right: 2.5rem;
}

.notification-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.notifications-panel {
    position: absolute;
    width: 350px;
    max-width: 90vw;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

body.dark-mode .notifications-panel {
    background-color: #2a2a2a;
    border-color: #444;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
}

body.dark-mode .notifications-header {
    border-color: #444;
}

.notifications-header h3 {
    margin: 0;
}

#mark-all-read {
    background: none;
    border: none;
    color: #4a90e2;
    cursor: pointer;
    font-size: 0.9rem;
}

body.dark-mode #mark-all-read {
    color: #62a8ff;
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

body.dark-mode .notification-item {
    border-color: #333;
}

.notification-item.unread {
    background-color: #f0f7ff;
}

body.dark-mode .notification-item.unread {
    background-color: #2c3e50;
}

.notification-content {
    flex: 1;
}

.notification-content p {
    margin: 0 0 0.5rem 0;
}

.notification-time {
    color: #777;
    font-size: 0.8rem;
}

body.dark-mode .notification-time {
    color: #aaa;
}

.mark-read-btn {
    width: 24px;
    height: 24px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Animations for smoother UX */
.notification-item,
.card-listing,
.watchlist-item,
.bid-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.notification-item:hover,
.card-listing:hover,
.watchlist-item:hover,
.bid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

body.dark-mode .notification-item:hover,
body.dark-mode .card-listing:hover,
body.dark-mode .watchlist-item:hover,
body.dark-mode .bid-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments for the new features */
@media (max-width: 768px) {
    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .activity-chart-container canvas {
        width: 100%;
        height: auto;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .notifications-panel {
        width: 100%;
        max-width: 100%;
        left: 0 !important;
        right: 0 !important;
        top: 60px !important;
        border-radius: 0;
    }
}

/* Add these CSS rules to your profile.css file */

/* Username edit styles */
.username-edit-wrapper {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between username and edit icon */
    margin-bottom: 10px;
}

.username {
    display: inline;
    margin-right: 5px;
}

#edit-username-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #4a90e2;
    padding: 5px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

#edit-username-btn:hover {
    color: #2a70c2;
    background-color: rgba(74, 144, 226, 0.1);
    border-radius: 4px;
}

#edit-username-input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.1rem;
    margin-right: 5px;
}

/* Member since positioning */
.member-since {
    color: #666;
    font-size: 0.9rem;
    margin-left: auto; /* This pushes it to the right */
}

/* Username container with proper layout */
.username-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow it to grow and take available space */
}

/* Make profile info a row with space-between */
.profile-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .member-since {
        margin-left: 0;
        align-self: flex-end;
        margin-top: 0.5rem;
    }
    
    .username-container {
        width: 100%;
    }
}