/* Basic reset and layout prevention */
html, body {
    margin: 0;                    /* Remove all margins */
    padding: 0;                   /* Remove all padding */
}

body {
    font-family: Arial, sans-serif;
    margin: 20px;                 /* RESTORE: Original margin on all pages */
    background-color: orange;     /* Orange background for ALL pages */
    box-sizing: border-box;       /* Include padding in calculations */
}

/* Style ONLY for home page - override the margin and add special handling */
.home-page {
    margin: 0;                    /* Remove margin only on home page */
    overflow: hidden;             /* Prevent all scrolling on home page */
    height: 100%;                 /* Full height only on home page */
    width: 100%;                  /* Full width only on home page */
}

/* Style for all other pages that need margins */
body:not(.home-page) {
    margin: 20px;                 /* Restore the 20px margin for non-home pages */
    overflow-y: auto;             /* Allow vertical scrolling */
}

@font-face {
    font-family: 'Luckiest Guy';
    src: url('/assets/fonts/LuckiestGuy-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


.title-hero {
    font-family: 'Luckiest Guy', cursive;
    font-size: 58px;
    color: #FFA500;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;

    text-shadow:
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    0 4px 6px rgba(0, 0, 0, 0.4);

}




input, button {
    margin: 5px;
    padding: 10px;
}

#message {
    margin-top: 20px;
    font-weight: bold;
}

#welcomeMessage {
    margin-top: 20px;
    font-size: 1.2em;
}

/* Seller Page Specific Styles */
#sellerForm {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#sellerForm textarea {
    width: 100%;
    height: 100px;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

#sellerForm input {
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#submitListing {
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
}

#submitListing:hover {
    background-color: #45a049;
}

/* Marketplace Listing Styles */
.listing {
    background: white;
    border-radius: 8px;
    margin: 15px 0;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.listing h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 1.2em;
}

.listing-details {
    display: grid;
    gap: 10px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-weight: bold;
    color: #666;
    min-width: 120px;
}

.detail-value {
    color: #444;
    word-break: break-all;
    text-align: right;
}

/* More robust fix for the crypto address display */
.listing .monospace {
    font-family: monospace;
    font-size: 0.9em;
    /* Remove background, border and padding that creates the black box */
    /*background-color: rgba(255, 255, 255, 0.7);*/
    /*padding: 3px 6px;*/
    /*border-radius: 3px;*/
    /*border: 1px solid #ddd;*/
    display: inline-block;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Fix for the fee info display */
.fee-info {
    margin-top: 10px;
    font-size: 0.85em;
    color: #333; /* Darker text for better readability on orange */
    padding-top: 5px;
    background-color: rgba(255, 255, 255, 0.7); /* Light background for better visibility */
    border-radius: 0 0 4px 4px;
    padding: 8px 10px;
}

.fee-info p {
    margin: 5px 0;
}

.fee-amount {
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.9); /* Highlight the amounts */
    padding: 2px 4px;
    border-radius: 3px;
}

/* Navbar Styles */
.navbar {
    background-color: #333;
    color: white;
    padding: 10px 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 5px;                    /* Subtle rounding for all corners */
    overflow: hidden;                      /* Ensure content doesn't overflow rounded corners */
}

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

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: bold;
    font-style: italic;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;                   /* Subtle rounding for nav links */
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: #4CAF50;
    font-weight: bold;
}

.nav-logout {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

.nav-logout:hover {
    background-color: #d32f2f;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Rating styles */
.rate-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.rate-btn:hover {
    background-color: #f57c00;
}

.rating-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Completed deals styles */
.completed-deal {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.deal-details {
    flex: 1;
}

.deal-details h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.deal-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.rated-badge {
    background-color: #4CAF50;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 14px;
}

.view-chat-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.view-chat-btn:hover {
    background-color: #0b7dda;
}

/* Right side container with perfect centering */
.home-page .right-side-container {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 0 5%;
}

.home-page .right-side-container h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    width: 100%;
}

#authForm {
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#authForm input {
    width: 100%;
    margin: 8px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.button-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.button-container button {
    width: 100%;                   /* Full width matching inputs */
    padding: 12px 10px;            /* Slightly more vertical padding for better proportions */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;              /* Medium weight for better readability */
    color: white;
    transition: background-color 0.2s, transform 0.1s; /* Smooth transitions */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Subtle shadow for depth */
}

.button-container button:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.15); /* Enhanced shadow on hover */
    transform: translateY(-1px);   /* Subtle lift effect */
}

.button-container button:active {
    transform: translateY(1px);    /* Press effect */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); /* Reduced shadow when pressed */
}

/* Primary action - Login */
.button-container button#authenticate {
    background-color: #1E3A8A;     /* Deep navy blue - complementary to orange */
    margin-bottom: 2px;            /* Small adjustment for visual balance */
}

.button-container button#authenticate:hover {
    background-color: #1e40af;     /* Slightly lighter navy on hover */
}

/* Secondary action - Register */
.button-container button#addUser {
    background-color: #3B82F6;     /* Lighter blue for secondary action */
    font-weight: 400;              /* Slightly lighter weight to reduce visual prominence */
}

.button-container button#addUser:hover {
    background-color: #60a5fa;     /* Lighter blue on hover */
}

/* Image styling - left side centered */
.home-page .astro-logo {
    max-width: 40%;
    height: auto;
    display: block;
    position: absolute;
    left: 0;
    width: 40%;
    top: 50%;
    transform: translateY(-50%);
    padding-left: 5%;
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    body {
        background-color: hsl(39, 100%, 50%);  /* Slightly refined orange */
        overflow-y: auto;                       /* Allow vertical scrolling on mobile */
        overflow-x: hidden;                     /* Prevent horizontal scrolling */
    }
    
    .home-page::after {
        display: none;                          /* Remove vertical divider */
    }

    /* Add this rule to enable scrolling on home page for mobile */
    .home-page {
        overflow-y: auto;                       /* Enable vertical scrolling */
        overflow-x: hidden;                     /* Prevent horizontal scrolling */
        height: auto;                           /* Allow content to determine height */
        position: relative;                     /* Ensure proper positioning context */
    }

    /* Fix the animation keyframes for static positioning */
    @keyframes float {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-10px); }
    }
    
    /* Logo positioning - centered above login form */
    .home-page .astro-logo {
        position: static;
        display: block;
        width: 50%;
        max-width: 220px;
        margin: 30px auto;                 /* Center horizontally with space above and below */
        padding: 0;
        top: auto;
        left: auto;
        transform: none;                   /* Reset transform initially */
        opacity: 0.95;
        filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
        animation: float 6s ease-in-out infinite; /* Use the updated animation */
    }
    
    /* Fix the login container positioning */
    .home-page .right-side-container {
        position: relative;
        width: 92%;
        height: auto;
        padding: 30px 20px;
        margin: 20px auto;                 /* Simple auto margin instead of the large top margin */
        margin-top: 10px;                  /* Small top margin to create space after the logo */
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        background: rgba(255,255,255,0.05);
        backdrop-filter: blur(8px);
        border-radius: 12px;
        animation: fadeRise 0.7s ease-out;
    }
    
    
    /* Elevated typography */
    .home-page .right-side-container h1 {
        font-size: 32px;
        font-weight: 300;
        letter-spacing: 0.2px;
        margin-bottom: 25px;
        color: rgba(0,0,0,0.85);                /* Slightly softer than pure black */
    }
    
    /* Enhanced form elements for touch */
    #authForm {
        width: 100%;
        max-width: none;                        /* Use percentage-based sizing */
    }
    
    #authForm input {
        height: 56px;                           /* Material Design touch target */
        font-size: 18px;
        padding: 0 16px;                        /* Side padding */
        margin: 8px 0 16px;
        border-radius: 6px;                     /* Slightly softer corners */
        border: 1px solid rgba(0,0,0,0.2);
        transition: all 0.2s ease;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    #authForm input:focus {
        border-color: #3B82F6;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3); /* Focus glow effect */
        transform: translateY(-1px);
    }
    
    .button-container {
        margin-top: 24px;                       /* Increased spacing */
        gap: 16px;                              /* More space between buttons */
    }
    
    .button-container button {
        height: 60px;                           /* Larger touch target */
        font-size: 18px;
        letter-spacing: 0.5px;                  /* Subtle letter spacing */
        border-radius: 8px;                     /* Slightly rounder corners */
        transition: transform 0.15s, background-color 0.3s; /* Refined transitions */
    }
    
    .button-container button:active {
        transform: scale(0.98);                 /* More pronounced press effect */
    }
    


    
    /* Security indicator below form */
    .button-container::after {
        content: "Secure login • Privacy protected";
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 16px;
        font-size: 12px;
        color: rgba(0,0,0,0.6);
        letter-spacing: 0.3px;
    }
    
    /* Animation keyframes */
    @keyframes fadeRise {
        0% { 
            opacity: 0;
            transform: translateY(20px);
        }
        100% { 
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes float {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-10px); }
    }
}

/* Progressive disclosure animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.home-page .right-side-container h1 {
    animation: fadeIn 0.8s ease-out;
}

.home-page #authForm {
    animation: fadeIn 1s ease-out 0.2s backwards;
}

/* Form validation visual cues */
input:not(:placeholder-shown):valid {
    border-color: #4CAF50 !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234CAF50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") 
        calc(100% - 12px) 50% no-repeat !important;
    padding-right: 40px !important;
}

input:not(:placeholder-shown):invalid {
    border-color: #f44336 !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f44336' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E") 
        calc(100% - 12px) 50% no-repeat !important;
    padding-right: 40px !important;
}

/* Add page-specific styling for the home page */
.home-page::after {
    content: '';
    position: fixed;
    left: 50%;
    top: 20vh;
    height: 60vh;
    width: 2px;
    background-color: orange; 
    z-index: 1;
    pointer-events: none;
}

/* Add container width constraints for marketplace listings */
#listings {
    max-width: 1200px;
    margin: 0 auto;
}

.listing-container {
    position: relative; /* Needed for absolute positioning of status badge */
    transition: opacity 0.3s ease;
}

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.listing-header h3 {
    margin: 0;
    flex-grow: 1;
    margin-right: 10px;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 10px; /* Space from title */
}

.status-sold {
    background-color: #ff9800; /* Orange */
    color: white;
}

.status-deleted {
    background-color: #757575; /* Grey */
    color: white;
}

/* Style for non-active listings */
.listing-container.status-sold,
.listing-container.status-deleted {
    opacity: 0.7;
    background-color: #f5f5f5; /* Slightly greyed out background */
}

.delete-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.delete-btn:hover {
    background-color: #d32f2f;
}

/* Notification System Styles */
.notification-container {
    position: relative;
}

.notification-bell {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    color: white; /* Make the bell icon white */
}

.notification-bell:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.notification-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: #ff4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    border: 2px solid #333;
}

.notification-badge.pulse {
    animation: pulse 1s 2;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.notification-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    width: 350px;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.notification-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h4 {
    margin: 0;
    font-size: 16px;
}

.mark-read-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.notification-list {
    padding: 10px 0;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.new_interest {
    background-color: #e3f2fd;
}

.notification-item.interest_accepted {
    background-color: #e8f5e9;
}

.notification-content p {
    margin: 0 0 4px 0;
    font-size: 14px;
}

.notification-content small {
    color: #666;
    font-size: 12px;
}

.notification-action {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 10px;
}

.notification-action:hover {
    background: #218838;
}

.no-notifications {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}