/* assets/css/coupon-system.css */
/* עיצוב מערכת הקופונים */

/* עיצוב שדה הקופון */
.coupon-section {
    background: linear-gradient(135deg, rgba(0, 133, 195, 0.15) 0%, rgba(0, 85, 150, 0.1) 100%);
    border: 1px solid rgba(0, 133, 195, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.coupon-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #0085c3, #ffc107, #0085c3);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.coupon-section h6 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coupon-section h6 i {
    font-size: 1.2em;
    color: #0085c3;
}

/* עיצוב שדה הקלט */
#coupon-input {
    border: 2px solid rgba(0, 133, 195, 0.5);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    background: rgba(0, 85, 150, 0.2);
    color: #ffffff;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#coupon-input:focus {
    border-color: #0085c3;
    box-shadow: 0 0 0 3px rgba(0, 133, 195, 0.3);
    outline: none;
    background: rgba(0, 85, 150, 0.3);
}

#coupon-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* עיצוב כפתור החלת קופון */
#apply-coupon-btn {
    background: linear-gradient(135deg, #0085c3 0%, #0066a3 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    color: #ffffff;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#apply-coupon-btn:hover {
    background: linear-gradient(135deg, #0066a3 0%, #0085c3 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 133, 195, 0.4);
}

#apply-coupon-btn:active {
    transform: translateY(0);
}

/* עיצוב הודעות קופון */
#coupon-message {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    display: none;
}

#coupon-message.text-success {
    background: rgba(0, 133, 195, 0.2);
    border: 1px solid rgba(0, 133, 195, 0.4);
    color: #ffffff;
}

#coupon-message.text-danger {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ffffff;
}

/* עיצוב פרטי הקופון */
#coupon-details {
    background: rgba(0, 133, 195, 0.15);
    border: 1px solid rgba(0, 133, 195, 0.4);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    backdrop-filter: blur(5px);
}

#coupon-details .alert {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #ffffff;
}

#coupon-discount-info {
    background: rgba(0, 85, 150, 0.2);
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
}

#coupon-discount-info strong {
    color: #0085c3;
    font-weight: 600;
}

/* עיצוב טבלת הקופונים ב-admin */
#coupons-table-body tr {
    transition: all 0.3s ease;
    background: rgba(0, 85, 150, 0.1);
}

#coupons-table-body tr:hover {
    background: rgba(0, 133, 195, 0.2) !important;
}

#coupons-table-body .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* עיצוב כפתורי פעולה */
.btn-group-sm .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    border: none;
    font-weight: 500;
}

.btn-group-sm .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* עיצוב טוגל בסגנון אייפון */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0 5px;
}

.toggle-switch.active {
    background: #28a745;
}

.toggle-switch.inactive {
    background: #6c757d;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(26px);
}

.toggle-switch.inactive .toggle-slider {
    transform: translateX(0);
}

.toggle-switch:hover {
    transform: scale(1.05);
}

.toggle-switch:active {
    transform: scale(0.95);
}

/* עיצוב טוגל מושבת */
.toggle-switch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.toggle-switch:disabled:hover {
    transform: none;
}

.toggle-switch:disabled:active {
    transform: none;
}

/* עיצוב כפתור מחיקה */
.delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #ffffff;
    border-radius: 0;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* עיצוב טופס יצירת קופון */
#create-coupon-btn {
    background: linear-gradient(135deg, #0085c3 0%, #0066a3 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    color: #ffffff;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#create-coupon-btn:hover {
    background: linear-gradient(135deg, #0066a3 0%, #0085c3 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 133, 195, 0.4);
}

/* עיצוב שדות הטופס */
.form-control:focus {
    border-color: #0085c3;
    box-shadow: 0 0 0 0.2rem rgba(0, 133, 195, 0.25);
}

/* אנימציות */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coupon-section {
    animation: fadeInUp 0.5s ease-out;
}

/* התאמות למובייל */
@media (max-width: 768px) {
    /* עיצוב שדה הקופון */
    .coupon-section {
        padding: 15px;
        margin: 15px 0;
        border-radius: 8px;
    }
    
    .coupon-section h6 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    #coupon-input {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    #apply-coupon-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    #coupon-discount-info {
        font-size: 13px;
        padding: 10px;
    }
    
    /* התאמות טבלאות למובייל */
    .table-responsive {
        border-radius: 8px;
        overflow: hidden;
    }
    
    .table-dark {
        font-size: 0.85rem;
    }
    
    .table-dark thead th {
        padding: 8px 4px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .table-dark tbody td {
        padding: 8px 4px;
        font-size: 0.8rem;
        vertical-align: middle;
    }
    
    /* התאמות badges למובייל */
    .badge {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* התאמות כפתורים למובייל */
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* התאמות טוגל למובייל */
    .toggle-switch {
        width: 40px;
        height: 20px;
        margin: 0 3px;
    }
    
    .toggle-slider {
        width: 16px;
        height: 16px;
        top: 2px;
        left: 2px;
    }
    
    .toggle-switch.active .toggle-slider {
        transform: translateX(20px);
    }
    
    /* התאמות כפתור מחיקה למובייל */
    .delete-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .delete-btn i {
        font-size: 0.8rem;
    }
    
    /* התאמות טופס יצירת קופון */
    #create-coupon-btn {
        padding: 10px 16px;
        font-size: 14px;
        width: 100%;
        margin-top: 10px;
    }
    
    /* התאמות שדות טופס */
    .form-control {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    /* התאמות כותרות */
    .card-header h5 {
        font-size: 1.1rem;
    }
    
    .card-header h6 {
        font-size: 1rem;
    }
    
    /* התאמות labels */
    label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    /* התאמות כפתור רענון */
    #refresh-usage-history-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        width: 100%;
        margin-top: 10px;
    }
    
    /* התאמות קישורים בטבלת שימוש */
    #coupon-usage-table-body a {
        font-size: 0.8rem;
        padding: 2px 4px;
    }
    
    /* התאמות תאריכים ושעות */
    #coupon-usage-table-body td:nth-child(4),
    #coupon-usage-table-body td:nth-child(5) {
        font-size: 0.75rem;
    }
    
    /* התאמות סכומי כסף */
    #coupon-usage-table-body td:nth-child(6) {
        font-size: 0.8rem;
    }
    
    /* התאמות הודעות */
    .alert {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    /* התאמות checkbox */
    #coupon-active {
        transform: scale(1.2);
    }
    
    /* התאמות select */
    #coupon-type {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    /* התאמות placeholder */
    #coupon-code::placeholder,
    #coupon-value::placeholder,
    #coupon-start-date::placeholder,
    #coupon-end-date::placeholder,
    #coupon-usage-limit::placeholder,
    #coupon-specific-email::placeholder {
        font-size: 13px;
    }
}

/* התאמות לטבלט */
@media (max-width: 1024px) and (min-width: 769px) {
    .table-dark {
        font-size: 0.9rem;
    }
    
    .table-dark thead th {
        padding: 10px 6px;
        font-size: 0.85rem;
    }
    
    .table-dark tbody td {
        padding: 10px 6px;
        font-size: 0.85rem;
    }
    
    .badge {
        font-size: 0.75rem !important;
        padding: 0.3rem 0.6rem !important;
    }
    
    .toggle-switch {
        width: 45px;
        height: 22px;
    }
    
    .toggle-slider {
        width: 18px;
        height: 18px;
    }
    
    .toggle-switch.active .toggle-slider {
        transform: translateX(23px);
    }
}

/* התאמות למסכים קטנים מאוד */
@media (max-width: 480px) {
    .coupon-section {
        padding: 10px;
        margin: 10px 0;
    }
    
    .table-dark {
        font-size: 0.75rem;
    }
    
    .table-dark thead th {
        padding: 6px 2px;
        font-size: 0.7rem;
    }
    
    .table-dark tbody td {
        padding: 6px 2px;
        font-size: 0.7rem;
    }
    
    .badge {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
    }
    
    .toggle-switch {
        width: 35px;
        height: 18px;
    }
    
    .toggle-slider {
        width: 14px;
        height: 14px;
    }
    
    .toggle-switch.active .toggle-slider {
        transform: translateX(17px);
    }
    
    .delete-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .delete-btn i {
        font-size: 0.75rem;
    }
    
    #coupon-input {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    #apply-coupon-btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .form-control {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    label {
        font-size: 0.85rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .card-header h6 {
        font-size: 0.9rem;
    }
}

/* מצב טעינה */
.coupon-loading {
    opacity: 0.6;
    pointer-events: none;
}

.coupon-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #0085c3;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* עיצוב התראות */
.alert-coupon {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* עיצוב סטטוס קופון */
.coupon-status-active {
    color: #0085c3;
    font-weight: 600;
}

.coupon-status-inactive {
    color: #dc3545;
    font-weight: 600;
}

.coupon-status-pending {
    color: #ffc107;
    font-weight: 600;
}

.coupon-status-expired {
    color: #6c757d;
    font-weight: 600;
}

.coupon-status-exhausted {
    color: #fd7e14;
    font-weight: 600;
}

/* עיצוב נוסף לטבלת הקופונים */
#coupons-table-body td {
    color: #ffffff;
    vertical-align: middle;
}

#coupons-table-body th {
    color: #0085c3;
    font-weight: 600;
    background-color: rgba(0, 133, 195, 0.2);
}

/* עיצוב שדות הטופס ב-admin */
#coupon-code,
#coupon-value,
#coupon-start-date,
#coupon-end-date,
#coupon-usage-limit,
#coupon-specific-email {
    background: rgba(0, 85, 150, 0.2);
    border: 1px solid rgba(0, 133, 195, 0.4);
    color: #ffffff;
    backdrop-filter: blur(5px);
}

#coupon-code:focus,
#coupon-value:focus,
#coupon-start-date:focus,
#coupon-end-date:focus,
#coupon-usage-limit:focus,
#coupon-specific-email:focus {
    background: rgba(0, 85, 150, 0.3);
    border-color: #0085c3;
    box-shadow: 0 0 0 0.2rem rgba(0, 133, 195, 0.25);
    color: #ffffff;
}

#coupon-code::placeholder,
#coupon-value::placeholder,
#coupon-start-date::placeholder,
#coupon-end-date::placeholder,
#coupon-usage-limit::placeholder,
#coupon-specific-email::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#coupon-type {
    background: rgba(0, 85, 150, 0.2);
    border: 1px solid rgba(0, 133, 195, 0.4);
    color: #ffffff;
    backdrop-filter: blur(5px);
}

#coupon-type:focus {
    background: rgba(0, 85, 150, 0.3);
    border-color: #0085c3;
    box-shadow: 0 0 0 0.2rem rgba(0, 133, 195, 0.25);
    color: #ffffff;
}

/* עיצוב checkbox */
#coupon-active {
    accent-color: #0085c3;
}

/* עיצוב כותרות ב-admin */
.card-header h5 {
    color: #ffffff !important;
}

.card-header h6 {
    color: #0085c3 !important;
}

/* עיצוב labels */
label {
    color: #ffffff;
    font-weight: 500;
}

/* עיצוב badges בטבלה */
.badge.bg-primary {
    background-color: #0085c3 !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* עיצוב כפתורים בטבלה - הוסר כי השתמשנו בעיצובים חדשים */

/* עיצוב רקע כללי לסקציה */
.dashboard-section .card {
    background: linear-gradient(135deg, rgba(0, 133, 195, 0.1) 0%, rgba(0, 85, 150, 0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 133, 195, 0.3);
}

.dashboard-section .card-header {
    background: rgba(0, 133, 195, 0.2);
    border-bottom: 1px solid rgba(0, 133, 195, 0.3);
}

.dashboard-section .card-body {
    background: transparent;
}

/* עיצוב טבלה כללי */
.table-dark {
    background: rgba(0, 85, 150, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    overflow: hidden;
}

.table-dark thead th {
    background: rgba(0, 133, 195, 0.2);
    color: #ffffff;
    border-color: rgba(0, 133, 195, 0.3);
}

.table-dark tbody td {
    border-color: rgba(0, 133, 195, 0.2);
}

/* התאמות טבלה למובייל */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
        box-shadow: none;
    }
    
    .table-dark {
        margin-bottom: 0;
    }
    
    /* הסתרת עמודות פחות חשובות במובייל */
    .table-dark th:nth-child(4),
    .table-dark td:nth-child(4),
    .table-dark th:nth-child(5),
    .table-dark td:nth-child(5) {
        display: none;
    }
    
    /* התאמת רוחב עמודות */
    .table-dark th:nth-child(1),
    .table-dark td:nth-child(1) {
        width: 25%;
    }
    
    .table-dark th:nth-child(2),
    .table-dark td:nth-child(2) {
        width: 15%;
    }
    
    .table-dark th:nth-child(3),
    .table-dark td:nth-child(3) {
        width: 20%;
    }
    
    .table-dark th:nth-child(6),
    .table-dark td:nth-child(6) {
        width: 15%;
    }
    
    .table-dark th:nth-child(7),
    .table-dark td:nth-child(7) {
        width: 15%;
    }
    
    .table-dark th:nth-child(8),
    .table-dark td:nth-child(8) {
        width: 10%;
    }
}

/* התאמות למסכים קטנים מאוד */
@media (max-width: 480px) {
    /* הסתרת עמודות נוספות במסכים קטנים */
    .table-dark th:nth-child(2),
    .table-dark td:nth-child(2),
    .table-dark th:nth-child(6),
    .table-dark td:nth-child(6) {
        display: none;
    }
    
    /* התאמת רוחב עמודות */
    .table-dark th:nth-child(1),
    .table-dark td:nth-child(1) {
        width: 35%;
    }
    
    .table-dark th:nth-child(3),
    .table-dark td:nth-child(3) {
        width: 30%;
    }
    
    .table-dark th:nth-child(7),
    .table-dark td:nth-child(7) {
        width: 20%;
    }
    
    .table-dark th:nth-child(8),
    .table-dark td:nth-child(8) {
        width: 15%;
    }
}

/* עיצוב טקסטים נוספים */
.text-center {
    color: #ffffff;
}

/* עיצוב form-check */
.form-check-label {
    color: #ffffff;
}

/* עיצוב select options */
#coupon-type option {
    background: rgba(0, 85, 150, 0.9);
    color: #ffffff;
}

/* כפתור רענון היסטוריית שימוש */
#refresh-usage-history-btn {
    background: rgba(0, 85, 150, 0.2);
    border: 1px solid rgba(0, 133, 195, 0.5);
    color: #ffffff;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#refresh-usage-history-btn:hover {
    background: rgba(0, 133, 195, 0.3);
    border-color: rgba(0, 133, 195, 0.7);
    transform: translateY(-1px);
}

/* טבלת היסטוריית שימוש */
#coupon-usage-table-body a {
    color: #45e0f9 !important;
    text-decoration: none;
    font-weight: bold;
}

#coupon-usage-table-body a:hover {
    color: #0dcaf0 !important;
    text-decoration: underline;
}

/* עיצוב תאריך ושעה בטבלת שימוש */
#coupon-usage-table-body td:nth-child(4),
#coupon-usage-table-body td:nth-child(5) {
    font-size: 0.9em;
    color: #bdeaff;
}

/* עיצוב סכומי כסף בטבלת שימוש */
#coupon-usage-table-body td:nth-child(6),
#coupon-usage-table-body td:nth-child(7),
#coupon-usage-table-body td:nth-child(8) {
    font-weight: bold;
    color: #ffffff;
}

/* התאמות טבלת היסטוריית שימוש למובייל */
@media (max-width: 768px) {
    /* הסתרת עמודות פחות חשובות בטבלת היסטוריית שימוש */
    #coupon-usage-table-body th:nth-child(4),
    #coupon-usage-table-body td:nth-child(4),
    #coupon-usage-table-body th:nth-child(5),
    #coupon-usage-table-body td:nth-child(5) {
        display: none;
    }
    
    /* התאמת רוחב עמודות */
    #coupon-usage-table-body th:nth-child(1),
    #coupon-usage-table-body td:nth-child(1) {
        width: 25%;
    }
    
    #coupon-usage-table-body th:nth-child(2),
    #coupon-usage-table-body td:nth-child(2) {
        width: 25%;
    }
    
    #coupon-usage-table-body th:nth-child(3),
    #coupon-usage-table-body td:nth-child(3) {
        width: 30%;
    }
    
    #coupon-usage-table-body th:nth-child(6),
    #coupon-usage-table-body td:nth-child(6) {
        width: 20%;
    }
}

/* התאמות למסכים קטנים מאוד */
@media (max-width: 480px) {
    /* הסתרת עמודות נוספות במסכים קטנים */
    #coupon-usage-table-body th:nth-child(3),
    #coupon-usage-table-body td:nth-child(3) {
        display: none;
    }
    
    /* התאמת רוחב עמודות */
    #coupon-usage-table-body th:nth-child(1),
    #coupon-usage-table-body td:nth-child(1) {
        width: 35%;
    }
    
    #coupon-usage-table-body th:nth-child(2),
    #coupon-usage-table-body td:nth-child(2) {
        width: 35%;
    }
    
    #coupon-usage-table-body th:nth-child(6),
    #coupon-usage-table-body td:nth-child(6) {
        width: 30%;
    }
}
