/**
 * WooCommerce Classified Listings Form Styles
 *
 * @package Woocommerce_Classified_Listings
 * @since 1.0.0
 */

/* Form Container */
.classified-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 18px;
}

/* Form Rows */
.form-row {
    margin-bottom: 20px;
}

.form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row.half {
    margin-bottom: 0;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Media Upload Section */
.media-upload-section {
    margin-top: 20px;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.upload-placeholder p {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.upload-info {
    font-size: 14px !important;
    color: #666 !important;
}

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

.uploaded-image {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: move;
}

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

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

.btn-set-featured,
.btn-delete-image {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: all 0.3s ease;
}

.btn-set-featured {
    background: rgba(255, 193, 7, 0.9);
    color: #fff;
}

.btn-set-featured:hover {
    background: #ffc107;
}

.btn-delete-image {
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
}

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

.featured-indicator {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #ffc107;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
}

.drag-handle {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    cursor: move;
}

/* Form Actions */
.form-actions {
    text-align: center;
    padding-top: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.btn-primary {
    background: #0073aa;
    color: #fff;
}

.btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #545b62;
    color: #fff;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Form Messages */
.form-messages {
    margin-top: 20px;
}

.classified-form-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

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

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

/* My Listings Section */
.my-classified-listings {
    max-width: 1200px;
    margin: 0 auto;
}

.listings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

.listings-header h3 {
    margin: 0;
    color: #333;
}

.listings-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.listings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.listings-table th,
.listings-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.listings-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.listings-table .listing-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.listing-title strong {
    display: block;
    margin-bottom: 3px;
}

.expired-label {
    color: #dc3545;
    font-size: 12px;
    font-weight: normal;
}

.listing-status span {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.listing-actions {
    white-space: nowrap;
}

.listing-actions .btn {
    margin: 0 2px;
    padding: 4px 8px;
    font-size: 11px;
}

.listing-row.expired {
    opacity: 0.6;
}

.no-listings {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.no-listings p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

/* Loading States */
.form-loading {
    position: relative;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area.uploading {
    pointer-events: none;
    opacity: 0.6;
}

.upload-progress {
    margin-top: 10px;
    padding: 10px;
    background: #f0f8ff;
    border-radius: 4px;
    font-size: 14px;
    color: #0073aa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .classified-form-container {
        padding: 20px;
        margin: 0 10px;
    }
    
    .form-row-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .uploaded-images {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .uploaded-image img {
        height: 100px;
    }
    
    .listings-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .listings-table-wrapper {
        margin: 0 -10px;
        border-radius: 0;
    }
    
    .form-actions .btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 20px 10px;
    }
    
    .upload-placeholder p {
        font-size: 14px;
    }
    
    .upload-info {
        font-size: 12px !important;
    }
}
