/* Reset CSS */
* {
    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: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Top Network Bar */
:root {
    --topbar-height: 34px;
}

.topbar {
    background: #e67e22;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 2px solid #d35400;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.topbar-brand i {
    margin-right: 5px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.topbar-nav a {
    color: #fff3e0;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.topbar-nav a:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.topbar-nav a.active {
    background: #fff;
    color: #e67e22;
    font-weight: 700;
}

/* Sponsored Badge */
.sponsored-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(253,180,153,0.22), rgba(148,197,249,0.22));
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow:
        0 4px 20px rgba(253,180,153,0.35),
        0 0 25px rgba(148,197,249,0.25),
        inset 0 1px 0 rgba(255,255,255,0.25);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.sponsored-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        transparent 0%,
        rgba(255,255,255,0.35) 50%,
        transparent 100%);
    transform: translateX(-100%);
    animation: sponsoredShine 3.5s ease-in-out infinite;
}
.sponsored-badge:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow:
        0 6px 28px rgba(253,180,153,0.55),
        0 0 35px rgba(148,197,249,0.45),
        inset 0 1px 0 rgba(255,255,255,0.35);
}
.sponsored-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.8px;
}
.sponsored-brand {
    font-weight: 800;
    background: linear-gradient(135deg, #fdb499, #94c5f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 6px rgba(253,180,153,0.55));
}
.sponsored-badge i {
    color: #fdb499;
    font-size: 0.8rem;
    filter: drop-shadow(0 0 4px rgba(253,180,153,0.9));
    animation: aiPulse 2s ease-in-out infinite;
}
.sponsored-desc {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    padding-left: 0;
    margin-left: 0;
    border-left: 1px solid transparent;
    transition:
        max-width 0.55s cubic-bezier(.4,.0,.2,1),
        opacity 0.35s ease 0.15s,
        padding-left 0.4s ease,
        margin-left 0.4s ease,
        border-color 0.4s ease;
}
.sponsored-badge:hover .sponsored-desc {
    max-width: 320px;
    opacity: 1;
    padding-left: 9px;
    margin-left: 3px;
    border-left: 1px solid rgba(255,255,255,0.35);
}
@keyframes sponsoredShine {
    0%   { transform: translateX(-100%); }
    60%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}
@keyframes aiPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.7; transform: scale(1.15); }
}

/* Header Styles */
header {
    background: linear-gradient(to right, #1c5e50, #4a6491);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: var(--topbar-height);
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    width: 50px;
    height: 50px;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 15px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.login-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-section a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.login-section a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: #2c3e50;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu .nav-menu {
    flex-direction: column;
    gap: 10px;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('../img/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 40px;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: #f36212;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background-color: #796fd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn.delete-btn {
    background-color: #e74c3c;
}

.btn.delete-btn:hover {
    background-color: #c0392b;
}

.btn.small-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* Announcement Grid */
.announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.announcement-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.announcement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.announcement-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.announcement-card:hover img {
    transform: scale(1.05);
}

.announcement-info {
    padding: 20px;
}

.announcement-info h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #f36f12;
    margin-bottom: 8px;
}

.location {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.announcement-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.announcement-actions .btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

/* Auth Form */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
}

.auth-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f36f12;
    box-shadow: 0 0 0 2px rgba(243, 111, 18, 0.2);
}

.error-message {
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s;
}

.success-message {
    background-color: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s;
}

/* User Profile */
.user-profile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.user-info {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.user-info h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.user-info p {
    margin-bottom: 15px;
}

.private-info {
    color: #7f8c8d;
    font-style: italic;
}

.form-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.form-section h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

/* Item View */
.item-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.item-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.item-image img:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.item-details h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.item-meta {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.item-meta p {
    margin-bottom: 10px;
}

.item-description {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.item-description h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.item-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Contact Page */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.item-summary {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.item-summary img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.item-details h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* Search Form */
.search-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-form .form-group {
    margin-bottom: 15px;
}

/* Admin Section */
.admin-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
    transition: box-shadow 0.3s;
}

.admin-section:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.admin-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

table th,
table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #ecf0f1;
    font-weight: bold;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 1;
}

table tr:hover {
    background-color: #f8f9fa;
}

/* Footer */
footer {
    background: linear-gradient(to right, #4a6491, #1c5e50);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    border-top: 3px solid #ff6b6b;
    width: 100%;
    position: relative;
    bottom: 0;
    left: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-logo {
    font-size: 2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.footer-logo i {
    color: #ff6b6b;
    margin-right: 10px;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ff6b6b;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all 0.3s;
}

.social-icons a:hover {
    background: #ff6b6b;
    transform: translateY(-3px);
}

.copyright {
    margin-top: 20px;
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #f36f12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .mobile-menu {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: #2c3e50;
        padding: 15px;
    }
    
    .announcements-grid {
        grid-template-columns: 1fr;
    }
    
    .item-view,
    .contact-container,
    .user-profile {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .announcement-actions {
        flex-direction: column;
    }
    
    .announcement-actions .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .item-actions {
        flex-direction: column;
    }
    
    .announcement-actions {
        flex-direction: column;
    }
    
    .announcement-actions a {
        width: 100%;
        text-align: center;
    }
}

@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
}

/* Master Admin Panel */
.master-admin-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.master-admin-panel h2 {
    color: white;
    margin-bottom: 20px;
}

.master-admin-panel .admin-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.master-admin-panel .admin-actions .btn {
    background-color: #28a745;
    padding: 12px 20px;
    font-weight: bold;
}

.master-admin-panel .admin-actions .btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* Responsive for master admin panel */
@media (max-width: 768px) {
    .master-admin-panel .admin-actions {
        flex-direction: column;
    }
    
    .master-admin-panel .admin-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Tables for statistics */
.top-users-table {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.top-users-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.top-users-table th,
.top-users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.top-users-table th {
    background-color: #ecf0f1;
    font-weight: bold;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 1;
}

.top-users-table tr:hover {
    background-color: #f8f9fa;
}

/* User stats card */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.stat-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1rem;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f36f12;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .top-users-table table {
        font-size: 0.9rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .top-users-table th,
    .top-users-table td {
        padding: 8px;
    }
    
    .top-users-table th,
    .top-users-table td {
        min-width: 120px;
    }
}

/* Message for banned users */
.top-users-table .banned-user {
    background-color: #ffebee;
    opacity: 0.7;
}

.top-users-table .banned-user span {
    color: #c62828;
    font-weight: bold;
}

/* High activity users */
.top-users-table .high-activity {
    background-color: #fff3e0;
}

/* Announcement card hover effects */
.announcement-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Standard images */
.item-image img,
.announcement-card img {
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Preview images */
.preview-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

/* Action buttons */
.announcement-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Registration form styles */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
}

.auth-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f36f12;
    box-shadow: 0 0 0 2px rgba(243, 111, 18, 0.2);
}

/* Search page styles */
.search-form .form-group {
    margin-bottom: 15px;
}

.search-form .form-group input {
    padding: 12px;
    font-size: 1rem;
}

/* Statistics grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Mobile menu styles */
.mobile-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: #2c3e50;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.mobile-menu.active {
    display: block;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

table th,
table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #ecf0f1;
    font-weight: bold;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 1;
}

table tr:hover {
    background-color: #f8f9fa;
}

/* Category selection */
.category-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.category-select label {
    font-weight: bold;
    color: #2c3e50;
}

.category-select select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    width: 200px;
}

/* Button styles */
.btn {
    display: inline-block;
    background-color: #f36212;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background-color: #796fd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn.delete-btn {
    background-color: #e74c3c;
}

.btn.delete-btn:hover {
    background-color: #c0392b;
}

.btn.small-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn.cancel-btn {
    background-color: #7f8c8d;
}

.btn.cancel-btn:hover {
    background-color: #95a5a6;
}

/* Item meta styles */
.item-meta {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.item-meta p {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.item-meta p span {
    font-weight: bold;
}

/* Registration and login form styles */
.auth-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #f36f12;
    box-shadow: 0 0 0 2px rgba(243, 111, 18, 0.2);
}

/* Item view layout */
.item-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.item-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.item-image img:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.item-details h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.item-description {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.item-description h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.item-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Search page styles */
.search-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-form .form-group {
    margin-bottom: 15px;
}

/* Admin page styles */
.admin-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
    transition: box-shadow 0.3s;
}

.admin-section:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.admin-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Category styling for announcements */
.announcement-info .category {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 10px;
}

/* Messages Styles */
.messages-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.messages-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.messages-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #f36f12;
}

.message-item.unread {
    background: #e3f2fd;
    border-left: 4px solid #3498db;
}

.message-preview p {
    margin: 10px 0;
    color: #333;
}

.message-view {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.message-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.message-content {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.message-reply {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.message-reply h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.message-actions {
    margin-top: 20px;
    text-align: center;
}

.char-count {
    margin-top: 5px;
    font-size: 0.9em;
    color: #7f8c8d;
}

/* Unread badge */
.unread-badge {
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8em;
    margin-left: 8px;
    position: relative;
    top: -2px;
}

.messages-link {
    position: relative;
    display: inline-block;
}

/* Responsive for messages */
@media (max-width: 768px) {
    .messages-container {
        grid-template-columns: 1fr;
    }
    
    .messages-section {
        width: 100%;
    }
    
    .message-view {
        padding: 20px;
    }
}

/* Fix for header notifications */
.login-section a.messages-link {
    position: relative;
}

.login-section a.messages-link .unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.7em;
    padding: 3px 6px;
}

/* Transaction Status Styles */
.transaction-status {
    margin: 20px 0;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.transaction-pending {
    background-color: #fff3cd;
    color: #856404;
}

.transaction-payment-sent {
    background-color: #cce5ff;
    color: #004085;
}

.transaction-payment-received {
    background-color: #d4edda;
    color: #155724;
}

.transaction-completed {
    background-color: #d1ecf1;
    color: #0c5460;
}

.transaction-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Buy Form Styles */
.buy-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.buy-form h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Feedback Styles */
.feedback-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.feedback-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.feedback-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.feedback-display h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.rating {
    display: flex;
    gap: 5px;
    margin: 15px 0;
}

.rating input[type="radio"] {
    display: none;
}

.rating label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.3s;
}

.rating input[type="radio"]:checked ~ label,
.rating label:hover,
.rating label:hover ~ label {
    color: #f39c12;
}

.feedback-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
}

.feedback-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.feedback-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.feedback-header h3 {
    margin-bottom: 5px;
    color: #2c3e50;
}

.feedback-header p {
    margin: 5px 0;
    color: #7f8c8d;
}

.feedback-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.feedback-footer {
    text-align: right;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Transaction Cards */
.transactions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.transaction-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.transaction-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.transaction-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.transaction-card p {
    margin-bottom: 8px;
}

/* Transaction History */
.transaction-history ul {
    list-style: none;
    padding: 0;
}

.transaction-history li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.transaction-history li:last-child {
    border-bottom: none;
}

/* Transaction Actions */
.transaction-actions {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.transaction-actions h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.transaction-actions p {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .item-summary {
        flex-direction: column;
    }
    
    .transactions-grid {
        grid-template-columns: 1fr;
    }
    
    .transaction-details {
        padding: 15px;
    }
    
    .transaction-actions {
        padding: 20px;
    }
}

/* Sold badge styling */
.sold-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: rotate(-5deg);
    border: 1px solid #c0392b;
}

/* Sold announcement styling */
.announcement-card.sold {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(0.7);
    transition: all 0.3s ease;
}

.announcement-card.sold:hover {
    opacity: 0.8;
    transform: translateY(-5px);
}

.item-view.sold {
    opacity: 0.7;
    pointer-events: none;
}

.item-view.sold .item-image img {
    opacity: 0.7;
    filter: grayscale(0.7);
}

/* Sold text overlay */
.sold-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    z-index: 5;
    pointer-events: none;
}

/* Sold text for item view */
.item-view.sold .sold-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1rem;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transform: rotate(-5deg);
    border: 1px solid #c0392b;
}

/* Disabled state */
.item-actions .btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

/* CAPTCHA styling */
.captcha-group {}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.captcha-text {
    font-size: 1.4rem;
    font-weight: bold;
    padding: 10px 20px;
    background: #f0f4f8;
    border-radius: 6px;
    color: #2c3e50;
    border: 2px dashed #aab;
    letter-spacing: 2px;
    flex: 1;
    text-align: center;
    user-select: none;
}

.captcha-refresh {
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 10px;
    transition: background 0.2s;
}

.captcha-refresh:hover {
    background: #ddd;
}

/* Honeypot: completamente nascosto agli utenti reali */
.hp-field {
    display: none !important;
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

/* Aggiungi questo a .form-group */
.form-group {
    margin-bottom: 20px;
}

/* Aggiungi questo a .form-group label */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

/* Aggiungi questo a .form-group input */
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #f36f12;
    box-shadow: 0 0 0 2px rgba(243, 111, 18, 0.2);
}

/* Aggiungi questo per i messaggi di errore specifici */
.error-message {
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s;
}

.success-message {
    background-color: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s;
}

/* Animazioni */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}