/**
 * IYG Auction Submit Form Styles
 *
 * @package IYG
 * @since 1.0.0
 */

/* Base Form Styles */
.auction-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auction-form-container * {
    box-sizing: border-box;
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2em;
    font-weight: 600;
}

.form-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* Form Sections */
.form-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h3 {
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #FEEC02;
    font-size: 1.4em;
    font-weight: 600;
}

/* Form Fields */
.form-field {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.form-field-half {
    flex: 1;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-field label.required::after {
    content: ' *';
    color: #e74c3c;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    background-color: #fff;
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus {
    border-color: #FEEC02;
    box-shadow: 0 0 0 3px rgba(254, 236, 2, 0.1);
}

.form-control.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-help {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}


.select2-selection {
    height: 50px !important;
    border: 2px solid #dee2e6 !important;
    font-size: 13px ;
}

/* Character Counter */
.character-counter {
    font-size: 12px;
    color: #6c757d;
    text-align: right;
    margin-top: 4px;
}

.character-counter.warning {
    color: #e67e22;
    font-weight: 600;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #FEEC02;
    background-color: rgba(254, 236, 2, 0.05);
}

.upload-area.uploading {
    border-color: #FEEC02;
}

.upload-instructions {
    margin-bottom: 20px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.upload-instructions p {
    font-size: 16px;
    color: #374151;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.upload-instructions small {
    color: #6b7280;
    font-size: 14px;
}

/* Per-file upload progress queue */
#upload-queue {
    list-style: none;
    margin: 10px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-queue-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 4px;
    background: #f8fafc;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
}

.upload-queue-name {
    grid-column: 1;
    grid-row: 1;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.upload-queue-pct {
    grid-column: 2;
    grid-row: 1;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: right;
}

.upload-progress-bar-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    background: #e5e7eb;
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: #FEEC02;
    border-radius: 999px;
    transition: width 0.15s ease;
}

.upload-queue-item--done .upload-progress-bar {
    background: #22c55e;
}

.upload-queue-item--error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.upload-queue-item--error .upload-progress-bar {
    background: #ef4444;
}

/* Uploaded Images Grid */
.uploaded-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.uploaded-image {
    position: relative;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    cursor: move;
    background: #fff;
    transition: all 0.3s ease;
}

.uploaded-image:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.uploaded-image.featured {
    border-color: #FEEC02;
    box-shadow: 0 0 0 3px rgba(254, 236, 2, 0.2);
}

.uploaded-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
}

.btn-set-featured,
.btn-delete-image {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-set-featured:hover {
    background: #FEEC02;
    color: #333;
}

.btn-delete-image:hover {
    background: #e74c3c;
}

.featured-indicator {
    background: #FEEC02;
    color: #333;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.drag-handle {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

/* Categories */
.categories-container {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #e1e5e9;
    padding: 20px;
    border-radius: 6px;
    background: #f8fafc;
}

.category-item {
    padding: 6px 0;
}

.category-item label {
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin: 0;
}

.category-item input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.category-item small {
    color: #6b7280;
    margin-left: 4px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    outline: none;
    text-align: center;
    line-height: 1.4;
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: #333;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #555;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-edit {
    background-color: #3498db;
    color: white;
}

.btn-complete {
    background-color: #27ae60;
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn:hover:not(:disabled) {
    opacity: 0.9;
}

/* Submit Section */
.form-submit-section {
    text-align: center;
    padding: 40px 30px;
    background: #f8fafc;
    border-radius: 8px;
}

/* Messages */
.auction-form-message {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid;
}

.auction-form-message.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.auction-form-message.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.auction-form-message.info {
    background-color: #cce7ff;
    border-color: #b3d9ff;
    color: #004085;
}

/* Form Loading State */
.form-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}

/* Login Required */
.auction-form-login-required,
.auction-form-error {
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    color: #374151;
}

/* My Auction Listings */
.my-auction-listings {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.my-auction-listings h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

.listings-table-container {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.listings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.listings-table th,
.listings-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.listings-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.listings-table tr:hover {
    background-color: #f8fafc;
}

.listings-table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge,
.stage-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

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

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

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

.status-live {
    background-color: #cce7ff;
    color: #004085;
}

.stage-badge {
    background-color: #e9ecef;
    color: #495057;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auction-form-container {
        padding: 15px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .uploaded-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .listings-table {
        font-size: 14px;
    }
    
    .listings-table th,
    .listings-table td {
        padding: 12px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-sm {
        width: 100%;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .form-header h2 {
        font-size: 1.5em;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .upload-instructions p {
        font-size: 14px;
    }
    
    .uploaded-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .uploaded-image img {
        height: 120px;
    }
}

/* Animation for sortable */
.uploaded-image.ui-sortable-helper {
    transform: rotate(5deg);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    z-index: 1000;
}

.uploaded-image.ui-sortable-placeholder {
    border: 2px dashed #FEEC02;
    background: rgba(254, 236, 2, 0.1);
    visibility: visible !important;
}

/* Focus states for accessibility */
.form-control:focus,
.btn:focus,
.category-item input:focus {
    outline: 2px solid #FEEC02;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .auction-form-container {
        box-shadow: none;
    }
    
    .form-section {
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    .btn {
        display: none;
    }
}

/* ==========================================================================
   Payment Form & Stripe Styles
   ========================================================================== */

.premium-payment-section {
    background: #fff;
    border: 2px solid #FEEC02;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.payment-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.payment-section-header h5 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.payment-total {
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-label {
    font-weight: 500;
    color: #495057;
}

.total-amount {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.stripe-payment-form h6 {
    margin: 0 0 15px 0;
    color: #495057;
    font-weight: 600;
    font-size: 16px;
}

.stripe-element {
    margin-bottom: 20px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 12px;
    background: #fff;
    min-height: 40px;
}

.billing-details-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.billing-details-section h6 {
    margin: 0 0 15px 0;
    color: #495057;
    font-weight: 600;
    font-size: 16px;
}

.billing-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.billing-field-half {
    flex: 1;
}

.billing-details-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.billing-details-section input,
.billing-details-section select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
}

.billing-details-section input:focus,
.billing-details-section select:focus {
    border-color: #FEEC02;
    outline: none;
    box-shadow: 0 0 0 2px rgba(254, 236, 2, 0.25);
}

.stripe-payment-errors {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
    min-height: 20px;
}

.stripe-payment-notice {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 15px;
}

.billing-details-section input.error,
.billing-details-section select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Coupon Section Styles */
.coupon-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.coupon-header h6 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.coupon-input-container {
    margin-bottom: 15px;
}

.coupon-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

#coupon-code {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#coupon-code:focus {
    outline: none;
    border-color: #FEEC02;
    box-shadow: 0 0 0 2px rgba(254, 236, 2, 0.2);
}

.apply-coupon-btn {
    background: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.apply-coupon-btn:hover {
    background: #555;
}

.apply-coupon-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.coupon-messages {
    margin-top: 10px;
    padding: 0;
}

.coupon-messages .success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.coupon-messages .error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.applied-coupon {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.coupon-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coupon-code-display {
    font-weight: 600;
    color: #155724;
    background: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
}

.coupon-discount {
    color: #155724;
    font-weight: 500;
    font-size: 14px;
}

.remove-coupon-btn {
    background: transparent;
    border: none;
    color: #155724;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.remove-coupon-btn:hover {
    background: rgba(21, 87, 36, 0.1);
}

.discounted-total {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.total-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtotal-row,
.discount-row,
.final-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subtotal-label,
.discount-label {
    color: #6c757d;
    font-size: 14px;
}

.final-total-label {
    font-weight: 600;
    font-size: 16px;
    color: #343a40;
}

.subtotal-amount {
    color: #6c757d;
    font-size: 14px;
}

.discount-amount {
    color: #28a745;
    font-weight: 500;
    font-size: 14px;
}

.final-total-amount {
    font-weight: 700;
    font-size: 18px;
    color: #333;
}

.final-total-row {
    border-top: 1px solid #dee2e6;
    padding-top: 8px;
    margin-top: 5px;
}

/* Payment Form Responsive Styles */
@media (max-width: 768px) {
    .payment-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .billing-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .billing-field-half {
        flex: 1;
    }

    .coupon-input-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .apply-coupon-btn {
        align-self: flex-end;
        width: auto;
        min-width: 100px;
    }
}