/**
 * Smart Support Widget - Public Styles
 */

/* Widget Container */
.smart-support-widget-container {
    position: fixed;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Widget Button */
.smart-support-widget-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.smart-support-widget-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.smart-support-widget-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.smart-support-widget-button-text {
    line-height: 1;
}

/* Widget Panel */
.smart-support-widget-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Adjust panel position based on widget position */
.smart-support-widget-container[style*="bottom"][style*="left"] .smart-support-widget-panel {
    left: 0;
    right: auto;
}

.smart-support-widget-container[style*="top"] .smart-support-widget-panel {
    top: 80px;
    bottom: auto;
}

/* Panel Header */
.smart-support-widget-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.smart-support-widget-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.smart-support-widget-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.smart-support-widget-close:hover {
    opacity: 1;
}

.smart-support-widget-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Panel Body */
.smart-support-widget-panel-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.smart-support-widget-welcome {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Search Section */
.smart-support-widget-search-section {
    margin-bottom: 20px;
}

.smart-support-widget-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.2s ease;
}

.smart-support-widget-search-box:focus-within {
    border-color: #007cba;
    background: #ffffff;
}

.smart-support-widget-search-box .dashicons-search {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #8c8f94;
    margin-right: 8px;
}

.smart-support-widget-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #2c3338;
    outline: none;
}

.smart-support-widget-search-input::placeholder {
    color: #8c8f94;
}

.smart-support-widget-search-loading {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #007cba;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Search Results */
.smart-support-widget-search-results {
    margin-top: 12px;
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.smart-support-widget-results-list {
    padding: 8px;
}

.smart-support-widget-result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.smart-support-widget-result-item:last-child {
    margin-bottom: 0;
}

.smart-support-widget-result-item:hover {
    background: #f6f7f7;
}

.smart-support-widget-result-item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #007cba;
    flex-shrink: 0;
    margin-top: 2px;
}

.smart-support-widget-result-content {
    flex: 1;
    min-width: 0;
}

.smart-support-widget-result-content strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3338;
    margin-bottom: 4px;
}

.smart-support-widget-result-content a {
    color: #2c3338;
    text-decoration: none;
}

.smart-support-widget-result-content a:hover strong {
    color: #007cba;
}

.smart-support-widget-result-title {
    cursor: pointer;
}

.smart-support-widget-result-title:hover {
    color: #007cba;
}

.smart-support-widget-result-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin: 4px 0 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.smart-support-widget-result-full {
    margin-top: 8px;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #2c3338;
}

.smart-support-widget-result-meta {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
}

.smart-support-widget-result-category {
    padding: 2px 8px;
    background: #e8e8e9;
    color: #2c3338;
    border-radius: 3px;
    font-weight: 500;
}

.smart-support-widget-result-status {
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.smart-support-widget-result-status.status-open {
    background: #d63638;
    color: #ffffff;
}

.smart-support-widget-result-status.status-working_on {
    background: #f0c33c;
    color: #2c3338;
}

.smart-support-widget-result-status.status-waiting {
    background: #00a32a;
    color: #ffffff;
}

.smart-support-widget-result-status.status-closed {
    background: #8c8f94;
    color: #ffffff;
}

.smart-support-widget-no-results {
    padding: 20px;
    text-align: center;
    color: #8c8f94;
    font-size: 13px;
    line-height: 1.5;
}

/* Widget Actions */
.smart-support-widget-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.smart-support-widget-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.smart-support-widget-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.smart-support-widget-btn-primary {
    background: #007cba;
    color: #ffffff;
}

.smart-support-widget-btn-primary:hover {
    background: #005a87;
    color: #ffffff;
}

.smart-support-widget-btn-secondary {
    background: #f0f0f1;
    color: #2c3338;
}

.smart-support-widget-btn-secondary:hover {
    background: #dcdcde;
    color: #2c3338;
}

/* Recent Tickets */
.smart-support-widget-recent-tickets {
    border-top: 1px solid #dcdcde;
    padding-top: 20px;
}

.smart-support-widget-recent-tickets h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3338;
}

.smart-support-widget-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smart-support-widget-ticket-item {
    background: #f6f7f7;
    border-radius: 6px;
    overflow: hidden;
}

.smart-support-widget-ticket-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    text-decoration: none;
    color: #2c3338;
    transition: background 0.2s ease;
}

.smart-support-widget-ticket-item a:hover {
    background: #e8e8e9;
}

.smart-support-widget-ticket-item .ticket-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.smart-support-widget-ticket-item .ticket-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smart-support-widget-ticket-item .ticket-status.status-open {
    background: #d63638;
    color: #ffffff;
}

.smart-support-widget-ticket-item .ticket-status.status-working_on {
    background: #f0c33c;
    color: #2c3338;
}

.smart-support-widget-ticket-item .ticket-status.status-waiting {
    background: #00a32a;
    color: #ffffff;
}

.smart-support-widget-ticket-item .ticket-status.status-closed {
    background: #8c8f94;
    color: #ffffff;
}

.smart-support-widget-no-tickets {
    text-align: center;
    color: #8c8f94;
    font-size: 13px;
    padding: 20px;
    margin: 0;
}

/* Guest Info */
.smart-support-widget-guest-info {
    border-top: 1px solid #dcdcde;
    padding-top: 16px;
    margin-top: 16px;
}

.smart-support-widget-guest-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.smart-support-widget-panel.animate-fade-in {
    animation: fadeIn 0.2s ease;
}

.smart-support-widget-panel.animate-fade-out {
    animation: fadeOut 0.2s ease;
}

.smart-support-widget-panel.animate-slide-in {
    animation: slideIn 0.3s ease;
}

.smart-support-widget-panel.animate-slide-out {
    animation: slideOut 0.3s ease;
}

.smart-support-widget-panel.animate-scale-in {
    animation: scaleIn 0.2s ease;
}

.smart-support-widget-panel.animate-scale-out {
    animation: scaleOut 0.2s ease;
}

/* Responsive */
@media (max-width: 480px) {
    .smart-support-widget-panel {
        width: calc(100vw - 40px);
    }
    
    .smart-support-widget-button-text {
        display: none;
    }
    
    .smart-support-widget-button {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}
