/* SKOOLY Suporte - Frontend CSS */

.skooly-suporte-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Tabs */
.skooly-suporte-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.tab-btn:hover {
    color: #111827;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tickets Header */
.tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.tickets-header h2 {
    margin: 0;
    font-size: 24px;
    color: #111827;
}

.tickets-filters {
    display: flex;
    gap: 12px;
}

.tickets-filters select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
    cursor: pointer;
}

/* No Tickets */
.no-tickets {
    text-align: center;
    padding: 80px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.no-tickets .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.no-tickets p {
    font-size: 18px;
    color: #6b7280;
    margin: 16px 0 24px;
}

/* Tickets Grid */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.ticket-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.ticket-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ticket-id {
    font-weight: 700;
    color: #111827;
    font-size: 14px;
}

.ticket-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-badge.status-aberto {
    background: #dcfce7;
    color: #166534;
}

.ticket-badge.status-em_andamento {
    background: #dbeafe;
    color: #1e40af;
}

.ticket-badge.status-aguardando {
    background: #fef3c7;
    color: #92400e;
}

.ticket-badge.status-fechado {
    background: #f3f4f6;
    color: #374151;
}

.ticket-badge.priority-alta {
    background: #fef2f2;
    color: #991b1b;
}

.ticket-badge.priority-urgente {
    background: #fee2e2;
    color: #7f1d1d;
}

.ticket-badge.badge-new-reply {
    background: #fef3c7;
    color: #92400e;
    animation: pulse 2s infinite;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ticket-badge.badge-new-reply .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ticket-card.has-new-reply {
    border-left: 4px solid #f59e0b;
}

.ticket-date {
    font-size: 12px;
    color: #9ca3af;
}

.ticket-body {
    margin: 16px 0;
}

.ticket-subject {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
    line-height: 1.4;
}

.ticket-topico {
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.ticket-topico .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ticket-footer {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-view, .btn-close {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-view {
    flex: 1;
    background: #eff6ff;
    color: #1e40af;
    justify-content: center;
}

.btn-view:hover {
    background: #dbeafe;
}

.btn-close {
    background: #fef2f2;
    color: #991b1b;
}

.btn-close:hover {
    background: #fee2e2;
}

/* Novo Ticket Form */
.novo-ticket-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.novo-ticket-container h2 {
    margin: 0 0 8px;
    font-size: 28px;
    color: #111827;
}

.subtitle {
    color: #6b7280;
    margin: 0 0 32px;
    font-size: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 32px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.ticket-details {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-row strong {
    min-width: 120px;
    color: #374151;
}

/* Messages */
.ticket-messages {
    margin: 24px 0;
}

.message-item {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid #e5e7eb;
}

.message-item.admin-message {
    background: #eff6ff;
    border-left-color: #2563eb;
}

.message-item.user-message {
    background: #f9fafb;
    border-left-color: #9ca3af;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.message-author {
    font-weight: 600;
    color: #111827;
}

.message-date {
    font-size: 12px;
    color: #9ca3af;
}

.message-content {
    color: #374151;
    line-height: 1.6;
}

/* Reply Section */
.reply-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
}

.reply-section h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #111827;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.loading:after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.loading-message {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #2563eb;
    background: #eff6ff;
    border-radius: 12px;
    border: 2px solid #dbeafe;
}

.loading-message .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .skooly-suporte-container {
        padding: 12px;
        margin: 20px auto;
    }
    
    .tickets-grid {
        grid-template-columns: 1fr;
    }
    
    .tickets-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tickets-filters {
        flex-direction: column;
    }
    
    .tickets-filters select {
        width: 100%;
    }
    
    .novo-ticket-container {
        padding: 20px;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
}

/* Login Message */
.skooly-suporte-login {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.skooly-suporte-login p {
    font-size: 18px;
    color: #6b7280;
    margin: 0 0 24px;
}

.btn-login {
    display: inline-block;
    padding: 12px 32px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-login:hover {
    background: #1d4ed8;
    color: white;
}
