/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 2rem;
    padding-left: 2rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.user-name {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    font-size: 0.85rem !important;
    padding: 0.5rem 1rem !important;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10;
}

/* Main Content */
main {
    padding: 2rem 0;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-align: center;
}

/* Search and Filters */
.search-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

#search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    border-color: #667eea;
}

#category-filter {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}

#distance-filter {
    width: 150px;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.item-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #999;
}

.item-content {
    padding: 1.5rem;
}

.item-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.item-description {
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.item-category {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.item-condition {
    color: #666;
    font-size: 0.9rem;
}

.item-location {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.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.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
}

/* Add Item Form */
.add-item-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
}

.location-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.location-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.location-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Swaps Section */
.swaps-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.swap-category h3 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.swap-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.swap-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.swap-items {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.swap-arrow {
    font-size: 1.5rem;
    color: #667eea;
}

.swap-item {
    flex: 1;
    text-align: center;
}

.swap-item-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.swap-item-owner {
    color: #666;
    font-size: 0.9rem;
}

.swap-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-accepted {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.swap-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 1rem;
    top: 1rem;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal-item-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.modal-item-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #333;
}

.modal-item-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.modal-item-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #666;
}

.modal-wanted-items {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.modal-wanted-items h4 {
    color: #1976d2;
    margin-bottom: 0.5rem;
}

.propose-swap-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 1.5rem;
}

.my-items-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .swaps-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1rem;
    }

    .modal-item-meta {
        grid-template-columns: 1fr;
    }
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.item-card {
    animation: fadeIn 0.5s ease-out;
}

/* Map Styles */
#map {
    border-radius: 10px;
}

.leaflet-popup-content {
    font-family: inherit;
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* User Authentication Styles */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-size: 0.9rem;
}

.user-menu span {
    font-weight: 500;
}

.user-menu .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.user-menu .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: none;
}

/* Loading States */
.loading-overlay {
    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: 10000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced Item Cards */
.item-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.item-card:hover::before {
    left: 100%;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-accepted {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Enhanced Modals */
.modal {
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .user-menu {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Enhanced Search Filters */
.search-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
}

.search-filters input[type="text"],
.search-filters select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-filters input[type="text"]:focus,
.search-filters select:focus {
    outline: none;
    border-color: #667eea;
}

.search-filters input[type="range"] {
    width: 100%;
}

@media (max-width: 768px) {
    .search-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Enhanced Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

.empty-state a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Improved Form Styling */
.add-item-form .form-group {
    margin-bottom: 1.5rem;
}

.add-item-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.add-item-form input,
.add-item-form select,
.add-item-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

.add-item-form input:focus,
.add-item-form select:focus,
.add-item-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.location-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 1rem;
}

.location-btn:hover {
    background: #218838;
}

.location-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    font-size: 0.9rem;
    color: #495057;
}

/* Enhanced Swap Cards */
.swap-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.swap-card:hover {
    transform: translateY(-2px);
}

.swap-items {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.swap-item {
    flex: 1;
    text-align: center;
}

.swap-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.swap-item-owner {
    font-size: 0.9rem;
    color: #666;
}

.swap-arrow {
    font-size: 1.5rem;
    color: #667eea;
    margin: 0 1rem;
}

.swap-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.swap-actions .btn {
    flex: 1;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

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

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

/* Profile Styles */
.profile-container {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.avatar-placeholder {
    font-size: 3rem;
    color: #999;
}

.profile-info {
    flex: 1;
}

.profile-info h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.profile-info p {
    color: #666;
    margin-bottom: 1rem;
}

.profile-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rating-stars {
    display: flex;
    gap: 0.25rem;
}

.rating-stars .star {
    font-size: 1.2rem;
    color: #ffd700;
}

.rating-stars .star.empty {
    color: #ddd;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.profile-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.profile-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.profile-section h4 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.activity-list,
.ratings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.activity-item .activity-type {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.activity-item .activity-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.activity-item .activity-time {
    color: #999;
    font-size: 0.8rem;
}

.rating-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ffd700;
}

.rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rating-user {
    font-weight: 600;
    color: #333;
}

.rating-stars-small {
    display: flex;
    gap: 0.1rem;
}

.rating-stars-small .star {
    font-size: 1rem;
    color: #ffd700;
}

.rating-comment {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.rating-date {
    color: #999;
    font-size: 0.8rem;
}

/* Rating Input Styles */
.rating-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.rating-input .star {
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ddd;
}

.rating-input .star:hover,
.rating-input .star.active {
    color: #ffd700;
    transform: scale(1.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* User Profile in Item Cards */
.item-owner-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.owner-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #666;
}

.owner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.owner-details {
    flex: 1;
}

.owner-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.owner-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.owner-rating .star {
    color: #ffd700;
    font-size: 0.7rem;
}

.rate-user-btn {
    background: #ffd700;
    color: #333;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rate-user-btn:hover {
    background: #ffed4e;
    transform: translateY(-1px);
}

/* Enhanced Swap Cards with Rating */
.swap-card .swap-user-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.swap-card .swap-user-rating .star {
    color: #ffd700;
    font-size: 0.7rem;
}

.swap-completed-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.swap-completed-actions .btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 0.5rem;
}

/* Responsive Profile Styles */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .profile-avatar {
        align-self: center;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .profile-sections {
        grid-template-columns: 1fr;
    }
    
    .profile-actions {
        flex-direction: column;
    }
}

/* Empty State for Profile Sections */
.profile-empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.profile-empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Loading States for Profile */
.profile-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.profile-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

/* Enhanced Modal Styles for Profile */
.modal-content h3 {
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Rating Display Utilities */
.rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-display .stars {
    display: flex;
    gap: 0.1rem;
}

.rating-display .rating-text {
    color: #666;
    font-size: 0.9rem;
}

/* Success/Error States for Profile Actions */
.profile-message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.profile-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.profile-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Hover Effects for Interactive Elements */
.rating-item:hover,
.activity-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Push Notification Styles */
.push-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: 350px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid #667eea;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.75rem;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.notification-text {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.notification-body {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: #f0f0f0;
    color: #333;
}

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

/* Notification Settings Panel */
.notification-settings {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.notification-settings h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.notification-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.notification-toggle-info {
    flex: 1;
}

.notification-toggle-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.notification-toggle-description {
    color: #666;
    font-size: 0.9rem;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: #667eea;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active::after {
    transform: translateX(26px);
}

.notification-permission-status {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-permission-status.granted {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification-permission-status.denied {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification-permission-status.default {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.permission-icon {
    font-size: 1.2rem;
}

.permission-text {
    flex: 1;
}

.permission-action {
    background: none;
    border: 2px solid currentColor;
    color: inherit;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.permission-action:hover {
    background: currentColor;
    color: white;
}

/* Mobile Responsive Notifications */
@media (max-width: 768px) {
    .push-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification-content {
        padding: 0.75rem;
    }
    
    .notification-settings {
        margin: 0 -20px 2rem -20px;
        border-radius: 0;
    }
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Notification List in Profile */
.notification-history {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.notification-history h4 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.notification-item-icon {
    font-size: 1.2rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.notification-item-content {
    flex: 1;
    min-width: 0;
}

.notification-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.notification-item-body {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.notification-item-time {
    color: #999;
    font-size: 0.8rem;
}

.notification-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.notification-item-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

/* Chat Styles */
.chat-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 70vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 500px;
}

.chat-sidebar {
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.chat-search {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.chat-search input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-search input:focus {
    border-color: #667eea;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.chat-item:hover {
    background: #e9ecef;
}

.chat-item.active {
    background: #667eea;
    color: white;
}

.chat-item.active .chat-item-name,
.chat-item.active .chat-item-preview,
.chat-item.active .chat-item-time {
    color: white;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #666;
    flex-shrink: 0;
    overflow: hidden;
}

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

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.chat-item-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    color: #999;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.chat-item-preview {
    color: #666;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-unread {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #666;
}

.welcome-content h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.welcome-content p {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 400px;
}

.chat-conversation {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #666;
    overflow: hidden;
}

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

.chat-header-info {
    flex: 1;
}

.chat-header-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.chat-header-status {
    color: #666;
    font-size: 0.85rem;
}

.chat-messages {
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(70vh - 150px);
}

.message {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 70%;
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.received {
    align-self: flex-start;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #666;
    flex-shrink: 0;
    overflow: hidden;
}

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

.message-content {
    flex: 1;
    min-width: 0;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.message.sent .message-bubble {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 6px;
}

.message.received .message-bubble {
    background: #f1f3f4;
    color: #333;
    border-bottom-left-radius: 6px;
}

.message-text {
    margin: 0;
    line-height: 1.4;
}

.message-time {
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.25rem;
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

.message.sent .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.message-system {
    align-self: center;
    max-width: 80%;
    text-align: center;
}

.message-system .message-bubble {
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 15px;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.message-deleted {
    opacity: 0.6;
    font-style: italic;
}

.chat-input-container {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    min-height: 80px;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-input-wrapper input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    resize: none;
    max-height: 100px;
}

.chat-input-wrapper input:focus {
    border-color: #667eea;
}

.send-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.send-btn span {
    font-size: 1.2rem;
}

/* Chat Empty States */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    text-align: center;
    padding: 2rem;
}

.chat-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chat-empty h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.chat-empty p {
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 300px;
}

/* Chat Loading States */
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.chat-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

/* Message Status Indicators */
.message-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.message.received .message-status {
    color: #999;
}

.status-icon {
    font-size: 0.8rem;
}

.status-sending {
    color: #ffd700;
}

.status-sent {
    color: #28a745;
}

.status-read {
    color: #007bff;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message Context Menu */
.message-menu {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 120px;
    overflow: hidden;
}

.message-menu-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: background-color 0.2s ease;
}

.message-menu-item:hover {
    background: #f8f9fa;
}

.message-menu-item.danger {
    color: #dc3545;
}

.message-menu-item.danger:hover {
    background: #f8d7da;
}

/* Chat Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        grid-template-columns: 1fr;
        height: 80vh;
    }
    
    .chat-sidebar {
        display: none;
    }
    
    .chat-sidebar.mobile-visible {
        display: flex;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
        background: white;
    }
    
    .chat-header {
        padding: 1rem;
    }
    
    .chat-messages {
        padding: 0.75rem;
    }
    
    .message {
        max-width: 85%;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    .mobile-chat-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #667eea;
        cursor: pointer;
        padding: 0.5rem;
    }
}

@media (min-width: 769px) {
    .mobile-chat-toggle {
        display: none;
    }
}

/* Chat Notification Badge */
.chat-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Message Reactions */
.message-reactions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.message-reaction {
    background: #f1f3f4;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.message-reaction:hover {
    background: #e9ecef;
}

.message-reaction.active {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
}

.reaction-emoji {
    font-size: 1rem;
}

.reaction-count {
    font-weight: 600;
    font-size: 0.75rem;
}

/* Chat Search Results */
.chat-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.chat-search-result {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

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

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

.search-result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.search-result-preview {
    color: #666;
    font-size: 0.85rem;
}

/* Message Link Previews */
.message-link-preview {
    margin-top: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 300px;
}

.link-preview-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: #f0f0f0;
}

.link-preview-content {
    padding: 0.75rem;
}

.link-preview-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.3;
}

.link-preview-description {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    color: #999;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Message Attachments */
.message-attachment {
    margin-top: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 250px;
}

.attachment-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    cursor: pointer;
}

.attachment-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
}

.attachment-icon {
    font-size: 1.5rem;
    color: #667eea;
}

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

.attachment-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    color: #666;
    font-size: 0.8rem;
}

.attachment-download {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.attachment-download:hover {
    background: #e9ecef;
}

/* Scroll to Bottom Button */
.scroll-to-bottom {
    position: absolute;
    bottom: 80px;
    right: 20px;
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 10;
}

.scroll-to-bottom:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.scroll-to-bottom span {
    font-size: 1.2rem;
}

/* Chat Animation Enhancements */
.message {
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-item {
    animation: chatItemSlideIn 0.2s ease-out;
}

@keyframes chatItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Dark Mode Support for Chat */
@media (prefers-color-scheme: dark) {
    .chat-container {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .chat-sidebar {
        background: #1a202c;
        border-right-color: #4a5568;
    }
    
    .chat-item {
        border-bottom-color: #4a5568;
    }
    
    .chat-item:hover {
        background: #4a5568;
    }
    
    .chat-item-name {
        color: #e2e8f0;
    }
    
    .chat-item-preview,
    .chat-item-time {
        color: #a0aec0;
    }
    
    .chat-header {
        background: #1a202c;
        border-bottom-color: #4a5568;
    }
    
    .chat-header-name {
        color: #e2e8f0;
    }
    
    .chat-header-status {
        color: #a0aec0;
    }
    
    .message.received .message-bubble {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .chat-input-container {
        background: #1a202c;
        border-top-color: #4a5568;
    }
    
    .chat-input-wrapper input {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .chat-input-wrapper input:focus {
        border-color: #667eea;
    }
}
