/* TP Clubigo Customer Manager - Frontend Styles */

/* הסתרת admin bar עבור לקוחות */
body.tp-customer-restricted #wpadminbar {
    display: none !important;
}

body.tp-customer-restricted {
    margin-top: 0 !important;
}

body.tp-customer-restricted.admin-bar {
    margin-top: 0 !important;
}

/* כפתור כניסה ללקוחות */
.tp-customer-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tp-customer-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 115, 170, 0.4);
}

/* Popup בסיסי */
.tp-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.tp-popup-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: tpPopupSlideIn 0.3s ease-out;
    font-size: 14px;
}

.tp-popup-large .tp-popup-content {
    max-width: 900px;
    width: 95%;
    font-size: 14px;
}

@keyframes tpPopupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* כותרת Popup */
.tp-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.tp-popup-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.tp-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-popup-close {
    font-size: 24px;
    color: #7f8c8d;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.tp-popup-close:hover {
    color: #e74c3c;
}

/* תוכן Popup */
.tp-popup-body {
    padding: 25px;
}

/* טפסים */
.tp-form {
    max-width: 100%;
}

.tp-form-group {
    margin-bottom: 20px;
}

.tp-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2c3e50;
}

.tp-form-group input,
.tp-form-group select,
.tp-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

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

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

/* כפתורים */
.tp-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

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

.tp-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
}

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

.tp-btn-secondary:hover {
    background: #5a6268;
}

/* קישורים */
.tp-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.tp-link:hover {
    text-decoration: underline;
}

.tp-text-center {
    text-align: center;
}

/* הודעות */
.tp-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 500;
}

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

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

/* ניווט דשבורד */
.tp-nav {
    display: flex;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 25px;
}

.tp-nav-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tp-nav-btn:hover,
.tp-nav-btn.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

/* תוכן דשבורד */
.tp-content {
    min-height: 400px;
}

.tp-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* סטטיסטיקות */
.tp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.tp-stat-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.tp-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tp-stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #0073aa;
    display: block;
    margin-bottom: 5px;
}

.tp-stat-label {
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
}

/* רשימת טיקטים */
.tp-tickets-table {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.tp-table-header {
    display: grid;
    grid-template-columns: 80px 1fr 100px 100px 120px;
    background: #f8f9fa;
    padding: 15px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #e1e5e9;
}

.tp-table-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 100px 120px;
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tp-table-row:hover {
    background: #f8f9fa;
}

.tp-table-row:last-child {
    border-bottom: none;
}

/* תגיות סטטוס ועדיפות */
.tp-status-badge,
.tp-priority-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.tp-status-open { background: #fff3cd; color: #856404; }
.tp-status-in_progress { background: #d1ecf1; color: #0c5460; }
.tp-status-closed { background: #d4edda; color: #155724; }

.tp-priority-low { background: #e2e3e5; color: #383d41; }
.tp-priority-medium { background: #fff3cd; color: #856404; }
.tp-priority-high { background: #f8d7da; color: #721c24; }

/* צפייה בטיקט */
.tp-ticket-view {
    max-width: 100%;
}

.tp-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5e9;
}

.tp-ticket-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tp-meta-item {
    font-size: 14px;
}

.tp-meta-item strong {
    color: #2c3e50;
}

.tp-ticket-content {
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.tp-content-text {
    line-height: 1.6;
    color: #495057;
}

/* תגובות */
.tp-replies {
    margin-bottom: 25px;
}

.tp-reply {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #e1e5e9;
}

.tp-reply-admin {
    background: #f8f9fa;
    border-left-color: #0073aa;
}

.tp-reply-customer {
    background: #fff;
    border-left-color: #28a745;
}

.tp-reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

.tp-admin-badge {
    background: #0073aa;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.tp-reply-date {
    color: #6c757d;
    margin-left: auto;
}

.tp-reply-content {
    line-height: 1.5;
    color: #495057;
}

/* טופס תגובה */
.tp-reply-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

/* אין טיקטים */
.tp-no-tickets {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Shortcode Styles */

/* כפתור shortcode */
.tp-btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.tp-btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.tp-btn-link {
    background: none !important;
    border: none !important;
    color: #0073aa !important;
    text-decoration: underline;
    padding: 4px 8px;
}

.tp-btn-link:hover {
    background: none !important;
    color: #005a87 !important;
}

/* דשבורד מוטמע */
.tp-embedded-dashboard {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.tp-dashboard-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tp-dashboard-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

.tp-embedded-nav {
    display: flex;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.tp-embedded-nav .tp-nav-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    flex: 1;
}

.tp-embedded-nav .tp-nav-btn:hover,
.tp-embedded-nav .tp-nav-btn.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background: white;
}

.tp-embedded-content {
    padding: 20px;
    min-height: 300px;
}

/* רשימת טיקטים פשוטה */
.tp-tickets-shortcode {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.tp-tickets-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tp-tickets-header h4 {
    margin: 0;
    color: #2c3e50;
}

.tp-tickets-simple-list {
    max-height: 400px;
    overflow-y: auto;
}

.tp-ticket-simple-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tp-ticket-simple-item:hover {
    background: #f8f9fa;
}

.tp-ticket-simple-item:last-child {
    border-bottom: none;
}

.tp-ticket-simple-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tp-ticket-simple-id {
    font-weight: 600;
    color: #0073aa;
}

.tp-ticket-simple-title {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.tp-ticket-simple-date {
    font-size: 12px;
    color: #6c757d;
}

/* אין טיקטים בשורטקוד */
.tp-tickets-shortcode .tp-no-tickets {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .tp-popup-content {
        width: 95%;
        margin: 10px;
    }

    .tp-table-header,
    .tp-table-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

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

    .tp-ticket-meta {
        grid-template-columns: 1fr;
    }

    .tp-page-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .tp-dashboard-header,
    .tp-tickets-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .tp-embedded-nav {
        flex-direction: column;
    }

    .tp-embedded-nav .tp-nav-btn {
        border-bottom: 1px solid #e1e5e9;
        border-left: 3px solid transparent;
    }

    .tp-embedded-nav .tp-nav-btn.active {
        border-left-color: #0073aa;
        border-bottom-color: #e1e5e9;
    }
}
