.coupon-system {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.coupon-navigation {
    margin-bottom: 20px;
    display: flex;
    justify-content: center; /* Center navigation */
}

.coupon-search {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap; /* Responsive for mobile */
    justify-content: center; /* Center search form elements */
}

.coupon-search input[type="text"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
    max-width: 100%; /* Responsive for mobile */
}

.coupon-search select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-width: 100%; /* Responsive for mobile */
}

.search-button {
    padding: 8px 16px;
    background-color: #005177;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #003a5c;
}

.add-coupon-button, .my-coupons-button {
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    color: white;
    transition: background-color 0.3s;
}

.add-coupon-button {
    background-color: #28a745;
}

.add-coupon-button:hover {
    background-color: #218838;
}

.my-coupons-button {
    background-color: #dc3545; /* Red for my-coupons */
}

.my-coupons-button:hover {
    background-color: #c82333;
}

.navigation-divider {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

.coupon-list {
    display: block; /* Single column layout */
}

.coupon-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    width: 100%; /* Full width for each coupon */
}

.coupon-system .coupon-header {
    display: flex;
    flex-direction: row-reverse; /* מציב את התמונה בימין והטקסט בשמאל ב-RTL */
    align-items: flex-start; /* התיאור יתחיל מלמעלה */
    gap: 10px;
    margin-bottom: 20px; /* רווח תחתון */
    text-align: right !important; /* יישור טקסט לימין */
    direction: rtl !important; /* תמיכה ב-RTL */
}

.coupon-image-wrapper {
    flex: 0 0 auto;
    margin-right: 20px;
}

.coupon-text {
    flex: 1; /* הטקסט תופס את השטח הנותר */
}

.coupon-text h2 {
    font-size: 1.2em;
    margin-bottom: 10px; /* רווח בין הכותרת לתיאור */
}

.coupon-text p.coupon-description {
    margin-top: 0; /* מבטל רווח עליון מיותר */
}

.coupon-image img {
    max-width: 100px;
    height: auto;
    border-radius: 4px;
}

.coupon-breadcrumbs {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 10px;
}

.coupon-action {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* Responsive for mobile */
    flex-direction: row-reverse; /* Reverse direction for RTL */
    justify-content: flex-end; /* Align items to the right in RTL */
}

.coupon-action .button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #ff6200;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.coupon-action .button:hover {
    background-color: #e55a00;
}

.coupon-action .coupon-code {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.coupon-action .copy-button {
    padding: 8px 16px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.coupon-action .copy-button:hover {
    background-color: #005f87;
}

.coupon-action .copy-button.copied {
    background-color: #28a745;
}

.delete-coupon-button {
    padding: 8px 16px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 10px;
}

.delete-coupon-button:hover {
    background-color: #c82333;
}

.coupon-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    direction: rtl; /* Ensure RTL alignment */
    text-align: right; /* Align text to the right */
    display: flex; /* Display meta items in a row */
    gap: 10px; /* Space between meta items */
}

.coupon-meta .meta-row {
    display: inline-block; /* Ensure each meta item is inline */
    margin-bottom: 0; /* Remove bottom margin */
}

.coupon-meta .meta-row strong {
    font-weight: bold; /* Make labels bold */
}

.coupon-meta .meta-row .discount-label {
    color: red; /* Make "הנחה:" label red */
}

.coupon-category {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    direction: rtl; /* Ensure RTL alignment */
    text-align: right; /* Align text to the right */
}

.coupon-category strong {
    font-weight: bold; /* Make "קטגוריה:" bold */
}

.coupon-tags {
    font-size: 0.85em;
    color: #777;
    direction: rtl; /* Ensure RTL alignment */
    text-align: right; /* Align text to the right */
}

.no-coupons, .no-login-message {
    text-align: center;
    padding: 20px;
    background: #dc3545; /* Red background */
    color: white; /* White text for contrast */
    border-radius: 4px;
    margin-bottom: 20px;
}

.success-message {
    width: 100%;
    text-align: center;
    padding: 15px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error.notice {
    width: 100%;
    padding: 15px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error.notice ul {
    margin: 0;
    padding-left: 20px;
}

.updated.notice {
    width: 100%;
    padding: 15px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group input, .form-group select {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.submit-button {
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-button:hover {
    background-color: #005f87;
}

.error-field {
    color: #dc3545;
}

/* New styles for RTL checkboxes */
.coupon-system .rtl-checkbox {
    float: right !important;
    margin-left: 10px !important;
}

/* Style for date input in RTL */
.coupon-system .rtl-date {
    direction: ltr;
    text-align: right;
}

/* Style for disabled buttons */
.button.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .coupon-system {
        padding: 10px;
    }
    .coupon-item {
        padding: 10px;
    }
    .coupon-header {
        flex-wrap: wrap;
    }
    .coupon-image img {
        max-width: 80px;
    }
    .coupon-meta {
        font-size: 0.8em;
        flex-direction: column; /* Stack meta items vertically on small screens */
    }
    .coupon-meta .meta-row {
        display: block;
    }
}

.date-selectors select {
    display: inline-block;
    margin-right: 10px;
}


/* === Compact controls: unify heights & spacing (main plugin only) === */
.coupon-system .coupon-action .button,
.coupon-system .coupon-action .copy-button,
.coupon-system .delete-coupon-button,
.coupon-system .coupon-action .coupon-code {
    height: 36px;
    display: inline-flex;
    align-items: center;
}

.coupon-system .coupon-action .button,
.coupon-system .coupon-action .copy-button,
.coupon-system .delete-coupon-button {
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 6px;
}

.coupon-system .coupon-action .coupon-code {
    padding: 6px 12px;
    line-height: 1.2;
    border-radius: 6px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
}

.coupon-system .coupon-action { gap: 8px; }

/* Search area compact */
.coupon-system .coupon-search input[type="text"],
.coupon-system .coupon-search button {
    height: 36px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 6px;
}


/* === Compact heights also for top navigation buttons === */
.coupon-system .coupon-navigation .add-coupon-button,
.coupon-system .coupon-navigation .my-coupons-button,
.coupon-system .coupon-navigation .search-button {
    height: 36px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}

/* Ensure search inputs & selects align to 36px, with equal spacing */
.coupon-system .coupon-navigation .coupon-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
}
.coupon-system .coupon-navigation .coupon-search input[type="text"],
.coupon-system .coupon-navigation .coupon-search select {
    height: 36px;
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 6px;
}

/* Equal spacing between action buttons on cards (including /my-coupons) */
.coupon-system .coupon-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
}
.coupon-system .coupon-action > * {
    margin: 0 !important; /* neutralize theme margins on buttons/inputs/links */
}
