/* ============================================
   SELL.CSS - Complete Styles for Sell Page
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.5;
}

/* ============================================
   HEADER STYLES
   ============================================ */

.sell-header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: all 0.3s;
    padding: 0.5rem 0;
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: #667eea;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1e293b;
    cursor: pointer;
}

/* ============================================
   USER MENU STYLES
   ============================================ */

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-btn, .register-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.login-btn {
    color: #667eea;
    border: 1px solid #667eea;
}

.login-btn:hover {
    background: #667eea;
    color: white;
}

.register-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 40px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}

.user-email {
    font-size: 0.75rem;
    color: #64748b;
}

.logout-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ============================================
   MAIN CONTENT STYLES
   ============================================ */

.sell-main {
    padding: 3rem 1rem;
    min-height: calc(100vh - 80px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-header p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
}

/* Verification Warning */
.verification-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.verification-warning i {
    font-size: 2.5rem;
    color: #856404;
}

.warning-content h3 {
    color: #856404;
    margin-bottom: 0.25rem;
    font-size: 1.2rem;
}

.warning-content p {
    color: #856404;
    margin: 0;
}

.warning-content a {
    color: #533f03;
    font-weight: 600;
    text-decoration: underline;
}

/* Form Container */
.sell-form-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* Form Sections */
.form-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.form-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.form-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.section-note {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group.half {
    margin-bottom: 0;
}

/* Input Fields */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #ef4444;
    background: #fef2f2;
}

/* Price Input */
.price-input {
    position: relative;
    display: flex;
    align-items: center;
}

.price-input .currency {
    position: absolute;
    left: 1rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
}

.price-input input {
    padding-left: 4rem !important;
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* Photo Upload Grid */
.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.photo-upload-box {
    aspect-ratio: 1;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

.photo-upload-box:hover {
    border-color: #667eea;
    background: #f1f5f9;
    transform: scale(1.02);
}

.photo-upload-box.has-image {
    border: 2px solid #667eea;
    cursor: default;
}

.photo-upload-box i {
    font-size: 2rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.photo-upload-box span {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    padding: 0 0.5rem;
}

.photo-upload-box .photo-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.photo-upload-box .remove-photo {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.photo-upload-box .remove-photo:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.photo-upload-box .main-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}

/* Photo Requirements */
.photo-requirements {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.photo-requirements p {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.photo-requirements p i {
    color: #667eea;
}

.photo-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.photo-requirements li {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.photo-requirements li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 600;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500 !important;
    color: #334155;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary, .btn-secondary {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 2;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    flex: 1;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Listing Preview */
.listing-preview {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
    transition: transform 0.3s;
}

.listing-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.listing-preview h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.listing-preview h3 i {
    color: #667eea;
}

.preview-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.preview-card:hover {
    border-color: #667eea;
}

.preview-image {
    height: 220px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.preview-image i {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.preview-image span {
    font-size: 0.9rem;
}

.preview-details {
    padding: 1.25rem;
}

.preview-details h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 0.75rem;
}

.preview-condition,
.preview-location {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-condition i,
.preview-location i {
    color: #667eea;
    width: 16px;
}

.preview-note {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 1rem;
    font-style: italic;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease;
    min-width: 300px;
    border-left: 4px solid;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left-color: #48bb78;
}

.toast-success i {
    color: #48bb78;
}

.toast-error {
    border-left-color: #f56565;
}

.toast-error i {
    color: #f56565;
}

.toast-warning {
    border-left-color: #ed8936;
}

.toast-warning i {
    color: #ed8936;
}

.toast-info {
    border-left-color: #4299e1;
}

.toast-info i {
    color: #4299e1;
}

.toast i {
    font-size: 1.2rem;
}

.toast span {
    flex: 1;
    font-size: 0.95rem;
    color: #1e293b;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.3s;
}

.toast-close:hover {
    color: #ef4444;
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: modalPop 0.4s ease;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

@keyframes modalPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content i {
    font-size: 5rem;
    color: #48bb78;
    margin-bottom: 1.5rem;
}

.modal-content h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1rem;
}

.modal-content p {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sell-form-container {
        grid-template-columns: 1fr 320px;
        gap: 1.5rem;
    }
}

@media (max-width: 968px) {
    .sell-form-container {
        grid-template-columns: 1fr;
    }
    
    .listing-preview {
        position: static;
        margin-top: 1rem;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .photo-upload-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .photo-upload-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .toast {
        min-width: auto;
        width: calc(100vw - 2rem);
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .sell-header {
        padding: 0.75rem 1rem;
    }
    
    .logo-text {
        display: none;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .photo-upload-grid {
        grid-template-columns: 1fr;
    }
    
    .user-info .user-details {
        display: none;
    }
    
    .user-info {
        padding: 0.25rem;
    }
    
    .logout-btn span {
        display: none;
    }
    
    .logout-btn {
        padding: 0.5rem;
    }
}

/* Location badge styles */
.user-location-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    color: white;
    flex-wrap: wrap;
}

.user-location-badge i {
    font-size: 20px;
}

.change-location-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.change-location-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Form text */
.form-text {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 12px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .user-location-badge {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .form-text {
        font-size: 11px;
    }
}