/**
 * Yad2 Second-hand Marketplace Styles
 *
 * Uses ez-gan design system variables.
 *
 * @package ez-gan
 */

/* =====================================================
   CSS Variables (ez-gan design system)
   ===================================================== */
:root {
    --yad2-primary: #3ECFB2;
    --yad2-primary-dark: #2eb89d;
    --yad2-secondary: #FFAB91;
    --yad2-accent: #FFD93D;
    --yad2-background: #FBF9F7;
    --yad2-text: #2D3748;
    --yad2-text-light: #718096;
    --yad2-white: #ffffff;
    --yad2-gray-100: #f7fafc;
    --yad2-gray-200: #edf2f7;
    --yad2-gray-300: #e2e8f0;
    --yad2-success: #48bb78;
    --yad2-warning: #ed8936;
    --yad2-danger: #e53e3e;
    --yad2-border-radius-sm: 8px;
    --yad2-border-radius: 12px;
    --yad2-border-radius-lg: 16px;
    --yad2-border-radius-xl: 24px;
    --yad2-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --yad2-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --yad2-transition: all 0.3s ease;
}

/* =====================================================
   Base Styles
   ===================================================== */
.yad2-page {
    padding-top: 40px;
    padding-bottom: 60px;
}

.yad2-board,
.yad2-my-listings,
.yad2-form-wrapper {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--yad2-text);
    line-height: 1.6;
    direction: rtl;
}

/* =====================================================
   Login Required Box
   ===================================================== */
.yad2-login-required {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 2rem;
}

.yad2-login-box {
    text-align: center;
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-xl);
    padding: 3rem;
    box-shadow: var(--yad2-shadow);
    max-width: 400px;
}

.yad2-login-icon {
    color: var(--yad2-primary);
    margin-bottom: 1.5rem;
}

.yad2-login-box h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--yad2-text);
}

.yad2-login-box p {
    color: var(--yad2-text-light);
    margin: 0 0 1.5rem;
}

/* =====================================================
   Buttons
   ===================================================== */
.yad2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--yad2-border-radius);
    border: none;
    cursor: pointer;
    transition: var(--yad2-transition);
    text-decoration: none;
    white-space: nowrap;
}

.yad2-btn-primary {
    background: var(--yad2-primary);
    color: var(--yad2-white);
}

.yad2-btn-primary:hover {
    background: var(--yad2-primary-dark);
    color: var(--yad2-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(62, 207, 178, 0.35);
}

.yad2-btn-secondary {
    background: var(--yad2-gray-200);
    color: var(--yad2-text);
}

.yad2-btn-secondary:hover {
    background: var(--yad2-gray-300);
    color: var(--yad2-text);
}

.yad2-btn-success {
    background: var(--yad2-success);
    color: var(--yad2-white);
}

.yad2-btn-success:hover {
    background: #38a169;
    color: var(--yad2-white);
}

.yad2-btn-danger {
    background: var(--yad2-danger);
    color: var(--yad2-white);
}

.yad2-btn-danger:hover {
    background: #c53030;
    color: var(--yad2-white);
}

.yad2-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--yad2-border-radius-sm);
}

.yad2-btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-radius: var(--yad2-border-radius);
}

.yad2-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.yad2-btn svg {
    flex-shrink: 0;
}

/* =====================================================
   Board Header
   ===================================================== */
.yad2-board-header,
.yad2-my-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.yad2-board-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--yad2-text);
}

.yad2-my-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--yad2-text);
}

/* =====================================================
   Filters - "Soft Playground" Design (matching Shop)
   ===================================================== */
.yad2-filters {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(230,255,250,0.4) 100%);
    backdrop-filter: blur(10px);
    border-radius: var(--ez-radius-lg, 24px);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    box-shadow:
        0 4px 24px rgba(62, 207, 178, 0.08),
        0 1px 3px rgba(0,0,0,0.04),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid rgba(62, 207, 178, 0.12);
    position: relative;
    overflow: visible;
}

/* Subtle decorative accent */
.yad2-filters::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,171,145,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.yad2-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.yad2-filter-group {
    flex: 1;
    min-width: 140px;
    position: relative;
}

/* Hide labels visually - placeholders guide users */
.yad2-filter-group label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Pill-shaped inputs with soft shadows */
.yad2-filter-group select,
.yad2-filter-group input[type="text"] {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    font-family: inherit;
    border: 2px solid transparent;
    border-radius: var(--ez-radius-full, 50px);
    background: var(--yad2-white);
    color: var(--yad2-text);
    box-shadow:
        0 2px 8px rgba(0,0,0,0.04),
        inset 0 1px 2px rgba(0,0,0,0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.yad2-filter-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.875rem center;
    padding-left: 2.25rem;
}

.yad2-filter-group input[type="text"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.875rem center;
    padding-left: 2.5rem;
}

.yad2-filter-group select:hover,
.yad2-filter-group input[type="text"]:hover {
    box-shadow:
        0 4px 12px rgba(62, 207, 178, 0.12),
        inset 0 1px 2px rgba(0,0,0,0.02);
    border-color: rgba(62, 207, 178, 0.3);
}

.yad2-filter-group select:focus,
.yad2-filter-group input[type="text"]:focus {
    outline: none;
    border-color: var(--yad2-primary);
    box-shadow:
        0 0 0 4px rgba(62, 207, 178, 0.15),
        0 4px 12px rgba(62, 207, 178, 0.1);
}

/* Placeholder styling */
.yad2-filter-group input::placeholder {
    color: var(--yad2-text-light);
    opacity: 0.8;
}

.yad2-search-group {
    flex: 1.8;
    min-width: 180px;
}

.yad2-filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Update filter buttons to match */
.yad2-filters .yad2-btn {
    padding: 0.7rem 1.25rem;
    border-radius: var(--ez-radius-full, 50px);
    font-size: 0.875rem;
}

.yad2-filters .yad2-btn-primary {
    background: linear-gradient(135deg, var(--yad2-primary) 0%, var(--yad2-primary-dark) 100%);
    box-shadow: 0 2px 8px rgba(62, 207, 178, 0.3);
}

.yad2-filters .yad2-btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(62, 207, 178, 0.4);
}

.yad2-filters .yad2-btn-secondary {
    background: rgba(45, 55, 72, 0.06);
}

.yad2-filters .yad2-btn-secondary:hover {
    background: rgba(45, 55, 72, 0.1);
}

/* =====================================================
   Results Info
   ===================================================== */
.yad2-results-info {
    font-size: 0.875rem;
    color: var(--yad2-text-light);
    margin-bottom: 1rem;
}

/* =====================================================
   Listings Grid
   ===================================================== */
.yad2-grid {
    display: grid;
    gap: 1.5rem;
}

.yad2-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.yad2-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.yad2-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
    .yad2-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .yad2-columns-3,
    .yad2-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .yad2-columns-2,
    .yad2-columns-3,
    .yad2-columns-4 {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Listing Card
   ===================================================== */
.yad2-card {
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-lg);
    overflow: hidden;
    box-shadow: var(--yad2-shadow);
    transition: var(--yad2-transition);
    height: 100%;
}

.yad2-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--yad2-shadow-hover);
}

.yad2-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.yad2-card-image {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--yad2-gray-100);
    overflow: hidden;
}

.yad2-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.yad2-card:hover .yad2-card-image img {
    transform: scale(1.05);
}

.yad2-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--yad2-gray-300);
}

.yad2-card-category {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--yad2-primary);
    color: var(--yad2-white);
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 50px;
}

.yad2-card-condition {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 50px;
    background: var(--yad2-gray-200);
    color: var(--yad2-text);
}

.yad2-card-condition.yad2-condition-new {
    background: var(--yad2-success);
    color: var(--yad2-white);
}

.yad2-card-condition.yad2-condition-like_new {
    background: #68d391;
    color: var(--yad2-white);
}

.yad2-card-condition.yad2-condition-used {
    background: var(--yad2-warning);
    color: var(--yad2-white);
}

.yad2-card-condition.yad2-condition-parts {
    background: var(--yad2-text-light);
    color: var(--yad2-white);
}

/* Edit icon on card (for owner) */
.yad2-card-edit-icon {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--yad2-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 5;
}

.yad2-card-edit-icon:hover {
    background: var(--yad2-primary);
    color: var(--yad2-white);
    transform: scale(1);
}

.yad2-card:hover .yad2-card-edit-icon {
    opacity: 1;
    transform: scale(1);
}

.yad2-card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.yad2-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--yad2-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yad2-card-excerpt {
    font-size: 0.875rem;
    color: var(--yad2-text-light);
    margin: 0 0 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yad2-card-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--yad2-text-light);
    margin-bottom: 0.75rem;
}

.yad2-card-location svg {
    flex-shrink: 0;
}

.yad2-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    margin-top: auto;
    border-top: 1px solid var(--yad2-gray-200);
}

.yad2-card-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--yad2-primary);
}

.yad2-card-price.no-price {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--yad2-text-light);
}

.yad2-card-date {
    font-size: 0.75rem;
    color: var(--yad2-text-light);
}

/* =====================================================
   No Results / Empty State
   ===================================================== */
.yad2-no-results,
.yad2-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-xl);
    box-shadow: var(--yad2-shadow);
}

.yad2-no-results-icon,
.yad2-empty-icon {
    color: var(--yad2-gray-300);
    margin-bottom: 1rem;
}

.yad2-no-results p,
.yad2-empty-state p {
    color: var(--yad2-text-light);
    margin: 0;
}

.yad2-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--yad2-text);
}

.yad2-empty-state .yad2-btn {
    margin-top: 1.5rem;
}

/* =====================================================
   Pagination
   ===================================================== */
.yad2-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.yad2-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.9375rem;
    border-radius: var(--yad2-border-radius);
    background: var(--yad2-white);
    color: var(--yad2-text);
    text-decoration: none;
    box-shadow: var(--yad2-shadow);
    transition: var(--yad2-transition);
}

.yad2-pagination .page-numbers:hover {
    background: var(--yad2-primary);
    color: var(--yad2-white);
}

.yad2-pagination .page-numbers.current {
    background: var(--yad2-primary);
    color: var(--yad2-white);
    font-weight: 600;
}

.yad2-pagination .page-numbers.dots {
    background: transparent;
    box-shadow: none;
}

/* =====================================================
   My Listings Table
   ===================================================== */
.yad2-table-wrapper {
    overflow-x: auto;
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-lg);
    box-shadow: var(--yad2-shadow);
}

.yad2-listings-table {
    width: 100%;
    border-collapse: collapse;
}

.yad2-listings-table th,
.yad2-listings-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--yad2-gray-200);
}

.yad2-listings-table th {
    background: var(--yad2-gray-100);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--yad2-text-light);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

.yad2-listings-table tbody tr:hover {
    background: var(--yad2-gray-100);
}

.yad2-col-image {
    width: 80px;
}

.yad2-col-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--yad2-border-radius-sm);
}

.yad2-placeholder {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--yad2-gray-100);
    border-radius: var(--yad2-border-radius-sm);
    color: var(--yad2-gray-300);
}

.yad2-col-title strong {
    display: block;
    font-weight: 600;
    color: var(--yad2-text);
}

.yad2-col-title small {
    color: var(--yad2-text-light);
    font-size: 0.8125rem;
}

.yad2-col-price {
    font-weight: 600;
    color: var(--yad2-primary);
}

.yad2-status {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 50px;
}

.yad2-status.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.yad2-status.status-active {
    background: #d1fae5;
    color: #065f46;
}

.yad2-status.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.yad2-status.status-draft {
    background: var(--yad2-gray-200);
    color: var(--yad2-text-light);
}

.yad2-expired-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--yad2-danger);
    color: var(--yad2-white);
    border-radius: 4px;
    margin-right: 0.25rem;
}

.yad2-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.yad2-actions-icons {
    display: flex;
    gap: 0.375rem;
}

.yad2-extend-btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    white-space: nowrap;
}

/* Mobile table hide, show cards */
@media (max-width: 768px) {
    .yad2-table-wrapper {
        display: none;
    }

    .yad2-listings-mobile {
        display: block;
    }
}

@media (min-width: 769px) {
    .yad2-listings-mobile {
        display: none;
    }
}

/* =====================================================
   Mobile Listing Cards
   ===================================================== */
.yad2-listing-mobile-card {
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--yad2-shadow);
}

.yad2-mobile-card-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.yad2-mobile-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--yad2-border-radius-sm);
    flex-shrink: 0;
}

.yad2-mobile-info {
    flex: 1;
    min-width: 0;
}

.yad2-mobile-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--yad2-text);
}

.yad2-mobile-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--yad2-primary);
    margin: 0;
}

.yad2-mobile-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--yad2-gray-200);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.yad2-mobile-expiry {
    font-size: 0.8125rem;
    color: var(--yad2-text-light);
}

/* =====================================================
   Form Styles
   ===================================================== */
.yad2-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.yad2-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.yad2-form-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--yad2-text);
}

.yad2-form {
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-xl);
    padding: 2rem;
    box-shadow: var(--yad2-shadow);
}

.yad2-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 576px) {
    .yad2-form-row {
        grid-template-columns: 1fr;
    }
}

.yad2-form-group {
    margin-bottom: 1.25rem;
}

.yad2-form-group label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--yad2-text);
    margin-bottom: 0.5rem;
}

.yad2-form-group label .required {
    color: var(--yad2-danger);
}

.yad2-form-group input[type="text"],
.yad2-form-group input[type="number"],
.yad2-form-group input[type="tel"],
.yad2-form-group select,
.yad2-form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--yad2-gray-300);
    border-radius: var(--yad2-border-radius);
    background: var(--yad2-white);
    color: var(--yad2-text);
    transition: var(--yad2-transition);
}

.yad2-form-group input:focus,
.yad2-form-group select:focus,
.yad2-form-group textarea:focus {
    outline: none;
    border-color: var(--yad2-primary);
    box-shadow: 0 0 0 3px rgba(62, 207, 178, 0.15);
}

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

.yad2-readonly {
    background-color: var(--yad2-gray-100) !important;
    cursor: not-allowed;
}

.yad2-help-text {
    display: block;
    font-size: 0.8125rem;
    color: var(--yad2-text-light);
    margin-top: 0.375rem;
}

/* Image Upload */
.yad2-image-upload {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.yad2-image-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed var(--yad2-gray-300);
    border-radius: var(--yad2-border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--yad2-transition);
}

.yad2-image-preview:hover {
    border-color: var(--yad2-primary);
}

.yad2-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yad2-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--yad2-gray-300);
    text-align: center;
    padding: 1rem;
}

.yad2-upload-placeholder span {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    color: var(--yad2-text-light);
}

.yad2-upload-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--yad2-primary);
    text-align: center;
    padding: 1rem;
}

.yad2-upload-loading span {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.yad2-upload-loading::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--yad2-gray-200);
    border-top-color: var(--yad2-primary);
    border-radius: 50%;
    animation: yad2-spin 0.8s linear infinite;
}

@keyframes yad2-spin {
    to { transform: rotate(360deg); }
}

.yad2-image-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Form Actions */
.yad2-form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--yad2-gray-200);
    text-align: center;
}

/* =====================================================
   Notices
   ===================================================== */
.yad2-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--yad2-border-radius);
    margin-bottom: 1.5rem;
}

.yad2-notice svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.yad2-notice-warning {
    background: #fef3c7;
    color: #92400e;
}

.yad2-notice-info {
    background: #dbeafe;
    color: #1e40af;
}

.yad2-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: var(--yad2-border-radius);
    text-align: center;
}

/* =====================================================
   Modal
   ===================================================== */
.yad2-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.yad2-modal-content {
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.yad2-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--yad2-gray-200);
}

.yad2-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--yad2-text);
}

.yad2-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--yad2-text-light);
    padding: 0;
    line-height: 1;
}

.yad2-modal-close:hover {
    color: var(--yad2-text);
}

.yad2-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Category Modal Specific */
.yad2-add-cat-form {
    background: var(--yad2-gray-100);
    padding: 1rem;
    border-radius: var(--yad2-border-radius);
    margin-bottom: 1.5rem;
}

.yad2-add-cat-form h4 {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--yad2-text);
}

.yad2-add-cat-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.yad2-add-cat-row input,
.yad2-add-cat-row select {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--yad2-gray-300);
    border-radius: var(--yad2-border-radius-sm);
}

.yad2-cat-table {
    width: 100%;
    border-collapse: collapse;
}

.yad2-cat-table th,
.yad2-cat-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid var(--yad2-gray-200);
}

.yad2-cat-table th {
    background: var(--yad2-gray-100);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--yad2-text-light);
}

.yad2-child-cat {
    padding-right: 1.5rem !important;
}

.yad2-cat-indent {
    color: var(--yad2-gray-300);
}

.yad2-cat-name-edit {
    width: 80%;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--yad2-gray-300);
    border-radius: 4px;
}

.yad2-cat-actions {
    white-space: nowrap;
}

.yad2-cat-actions .yad2-btn {
    margin-left: 0.25rem;
}

.yad2-no-categories {
    text-align: center;
    color: var(--yad2-text-light);
    padding: 2rem;
}

/* =====================================================
   Responsive Adjustments
   ===================================================== */
@media (max-width: 768px) {
    .yad2-board-header,
    .yad2-my-header,
    .yad2-form-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .yad2-board-header .yad2-btn,
    .yad2-my-header .yad2-btn {
        width: 100%;
    }

    .yad2-filters {
        padding: 0.875rem;
        border-radius: 16px;
    }

    .yad2-filters-row {
        flex-direction: column;
        gap: 0.625rem;
    }

    .yad2-filter-group,
    .yad2-search-group {
        width: 100%;
        min-width: 100%;
    }

    .yad2-filter-actions {
        width: 100%;
        margin-top: 0.25rem;
    }

    .yad2-filter-actions .yad2-btn {
        flex: 1;
    }

    .yad2-form {
        padding: 1.5rem;
    }

    .yad2-image-upload {
        flex-direction: column;
        align-items: center;
    }

    .yad2-image-actions {
        flex-direction: row;
    }
}

/* =====================================================
   Loading States
   ===================================================== */
.yad2-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.yad2-btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.5rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: yad2-spin 0.8s linear infinite;
}

@keyframes yad2-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   Success Popup
   ===================================================== */
.yad2-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: yad2-fadeIn 0.3s ease;
}

@keyframes yad2-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.yad2-success-popup {
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-xl);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: yad2-slideUp 0.4s ease;
}

@keyframes yad2-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.yad2-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--yad2-primary), var(--yad2-primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.yad2-success-icon svg {
    stroke: white;
}

.yad2-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--yad2-text);
    margin: 0 0 0.75rem;
}

.yad2-success-message {
    font-size: 1rem;
    color: var(--yad2-text-light);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.yad2-success-popup .yad2-btn {
    min-width: 150px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* =====================================================
   Image Cropper Modal
   ===================================================== */
.yad2-cropper-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
}

.yad2-cropper-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.yad2-cropper-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.yad2-cropper-container {
    position: relative;
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: yad2-slideUp 0.3s ease;
}

.yad2-cropper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--yad2-gray-200);
    direction: rtl;
}

.yad2-cropper-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--yad2-text);
}

.yad2-cropper-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--yad2-text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--yad2-transition);
}

.yad2-cropper-close:hover {
    background: var(--yad2-gray-100);
    color: var(--yad2-text);
}

.yad2-cropper-body {
    padding: 1rem;
    background: var(--yad2-gray-100);
}

.yad2-cropper-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 400px;
    background: #1a1a1a;
    border-radius: var(--yad2-border-radius);
    overflow: hidden;
}

.yad2-cropper-wrapper img {
    display: block;
    max-width: 100%;
}

.yad2-cropper-hint {
    text-align: center;
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--yad2-text-light);
}

.yad2-cropper-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--yad2-gray-200);
    direction: rtl;
}

.yad2-cropper-footer .yad2-btn {
    flex: 1;
    justify-content: center;
}

/* Body scroll lock when cropper is open */
body.yad2-cropper-open {
    overflow: hidden;
}

/* Cropper.js overrides for RTL and styling */
.yad2-cropper-wrapper .cropper-container {
    direction: ltr;
}

.yad2-cropper-wrapper .cropper-view-box {
    border-radius: var(--yad2-border-radius-sm);
    outline: 2px solid var(--yad2-primary);
    outline-offset: -2px;
}

.yad2-cropper-wrapper .cropper-line,
.yad2-cropper-wrapper .cropper-point {
    background-color: var(--yad2-primary);
}

.yad2-cropper-wrapper .cropper-modal {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Fix image preview to be 1:1 aspect ratio */
.yad2-image-preview {
    aspect-ratio: 1 / 1 !important;
    width: 100%;
    max-width: 200px;
}

.yad2-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .yad2-cropper-container {
        width: 95%;
        border-radius: var(--yad2-border-radius-lg);
    }

    .yad2-cropper-wrapper {
        max-height: 300px;
    }

    .yad2-cropper-footer {
        flex-direction: column;
    }

    .yad2-cropper-footer .yad2-btn {
        width: 100%;
    }
}

/* =====================================================
   Listing Detail Modal
   ===================================================== */
.yad2-listing-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
}

.yad2-listing-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.yad2-listing-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: yad2-fadeIn 0.2s ease;
}

.yad2-listing-modal-container {
    position: relative;
    background: var(--yad2-white);
    border-radius: var(--yad2-border-radius-xl);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: yad2-slideUp 0.3s ease;
    direction: rtl;
}

.yad2-listing-modal-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
    background: var(--yad2-white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--yad2-text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: var(--yad2-transition);
}

.yad2-listing-modal-close:hover {
    background: var(--yad2-gray-100);
    transform: scale(1.1);
}

.yad2-listing-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 90vh;
}

/* Image Section */
.yad2-listing-modal-image {
    background: var(--yad2-gray-100);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.yad2-listing-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yad2-listing-modal-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--yad2-gray-300);
}

/* Details Section */
.yad2-listing-modal-details {
    padding: 2rem;
    overflow-y: auto;
    max-height: 90vh;
}

.yad2-listing-modal-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.yad2-listing-modal-category {
    background: var(--yad2-primary);
    color: var(--yad2-white);
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 50px;
}

.yad2-listing-modal-condition {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 50px;
    background: var(--yad2-gray-200);
    color: var(--yad2-text);
}

.yad2-listing-modal-condition.yad2-condition-new {
    background: var(--yad2-success);
    color: var(--yad2-white);
}

.yad2-listing-modal-condition.yad2-condition-like_new {
    background: #68d391;
    color: var(--yad2-white);
}

.yad2-listing-modal-condition.yad2-condition-used {
    background: var(--yad2-warning);
    color: var(--yad2-white);
}

.yad2-listing-modal-condition.yad2-condition-parts {
    background: var(--yad2-text-light);
    color: var(--yad2-white);
}

.yad2-listing-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--yad2-text);
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.yad2-listing-modal-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--yad2-primary);
    margin-bottom: 1.25rem;
}

.yad2-listing-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--yad2-gray-200);
}

.yad2-listing-modal-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--yad2-text-light);
}

.yad2-listing-modal-meta-item svg {
    flex-shrink: 0;
    color: var(--yad2-primary);
}

.yad2-listing-modal-description {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--yad2-text);
    margin-bottom: 1.5rem;
}

.yad2-listing-modal-description p,
.yad2-listing-modal-description h1,
.yad2-listing-modal-description h2,
.yad2-listing-modal-description h3,
.yad2-listing-modal-description h4,
.yad2-listing-modal-description ul,
.yad2-listing-modal-description ol {
    margin: 0 0 0.5rem;
}

.yad2-listing-modal-description p:last-child,
.yad2-listing-modal-description ul:last-child,
.yad2-listing-modal-description ol:last-child {
    margin-bottom: 0;
}

.yad2-listing-modal-description h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.yad2-listing-modal-description h3 {
    font-size: 1rem;
    font-weight: 600;
}

.yad2-listing-modal-description ul,
.yad2-listing-modal-description ol {
    padding-right: 1.25rem;
}

.yad2-listing-modal-description li {
    margin-bottom: 0.25rem;
}

.yad2-listing-modal-description li:last-child {
    margin-bottom: 0;
}

.yad2-listing-modal-contact {
    background: var(--yad2-gray-100);
    border-radius: var(--yad2-border-radius-lg);
    padding: 1.25rem;
}

.yad2-listing-modal-contact h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--yad2-text);
    margin: 0 0 1rem;
}

.yad2-listing-modal-contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.yad2-listing-modal-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--yad2-text);
}

.yad2-listing-modal-contact-item svg {
    flex-shrink: 0;
    color: var(--yad2-text-light);
}

.yad2-listing-modal-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: var(--yad2-primary);
    color: var(--yad2-white);
    text-decoration: none;
    border-radius: var(--yad2-border-radius);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--yad2-transition);
}

.yad2-listing-modal-phone:hover {
    background: var(--yad2-primary-dark);
    color: var(--yad2-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(62, 207, 178, 0.35);
}

.yad2-listing-modal-phone svg {
    flex-shrink: 0;
}

/* Modal edit button (for owner) */
.yad2-listing-modal-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--yad2-gray-200);
}

.yad2-listing-modal-actions .yad2-btn {
    width: 100%;
    justify-content: center;
}

/* Clickable card cursor */
.yad2-card-clickable {
    cursor: pointer;
}

/* Body scroll lock when modal is open */
body.yad2-modal-open {
    overflow: hidden;
}

/* Mobile responsive for listing modal */
@media (max-width: 768px) {
    .yad2-listing-modal-content {
        grid-template-columns: 1fr;
        max-height: 90vh;
        overflow-y: auto;
    }

    .yad2-listing-modal-image {
        aspect-ratio: 16 / 10;
        max-height: 250px;
    }

    .yad2-listing-modal-details {
        padding: 1.5rem;
        max-height: none;
        overflow-y: visible;
    }

    .yad2-listing-modal-container {
        max-height: 90vh;
        overflow-y: auto;
    }

    .yad2-listing-modal-title {
        font-size: 1.25rem;
    }

    .yad2-listing-modal-price {
        font-size: 1.5rem;
    }

    .yad2-listing-modal-close {
        top: 0.75rem;
        left: 0.75rem;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .yad2-listing-modal-container {
        width: 95%;
        border-radius: var(--yad2-border-radius-lg);
    }

    .yad2-listing-modal-details {
        padding: 1.25rem;
    }

    .yad2-listing-modal-contact {
        padding: 1rem;
    }

    .yad2-listing-modal-phone {
        width: 100%;
        justify-content: center;
    }
}
