/* Novera Smart Chat Admin Styles */

.novera-smart-chat-admin-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.novera-smart-chat-main-content {
    flex: 1;
    background: white;
    padding: 20px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.novera-smart-chat-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Tabs */
.novera-smart-chat-tabs {
    margin-top: 20px;
}

.novera-smart-chat-tab-nav {
    display: flex;
    border-bottom: 1px solid #ccd0d4;
    margin-bottom: 20px;
}

.novera-smart-chat-tab-button {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    color: #646970;
    transition: all 0.3s ease;
}

.novera-smart-chat-tab-button:hover {
    color: #135e96;
}

.novera-smart-chat-tab-button.active {
    color: #135e96;
    border-bottom-color: #25D366;
    font-weight: 600;
}

.novera-smart-chat-tab-content {
    display: none;
}

.novera-smart-chat-tab-content.active {
    display: block;
}

/* Widgets */
.novera-smart-chat-widget {
    background: white;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    padding: 15px;
}

.novera-smart-chat-widget h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1d2327;
}

/* Preview */
.novera-smart-chat-preview-container {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
}

.novera-smart-chat-preview-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
}

.novera-smart-chat-preview-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

/* Quick Stats */
.novera-smart-chat-quick-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.novera-smart-chat-stat {
    text-align: center;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 4px solid #25D366;
}

.novera-smart-chat-stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #1d2327;
    margin-bottom: 5px;
}

.novera-smart-chat-stat-label {
    font-size: 12px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters */
.novera-smart-chat-filters {
    background: white;
    padding: 15px;
    border: 1px solid #ccd0d4;
    margin-bottom: 20px;
    border-radius: 4px;
}

.novera-smart-chat-filters form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#custom_date_range {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Stats Cards */
.novera-smart-chat-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.novera-smart-chat-stat-card {
    background: white;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.novera-smart-chat-stat-card:hover {
    transform: translateY(-2px);
}

.novera-smart-chat-stat-card .novera-smart-chat-stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #1d2327;
    margin-bottom: 8px;
}

.novera-smart-chat-stat-card .novera-smart-chat-stat-label {
    font-size: 14px;
    color: #646970;
    margin-bottom: 10px;
}

.novera-smart-chat-stat-change {
    font-size: 12px;
}

.novera-smart-chat-stat-change .positive {
    color: #00a32a;
}

.novera-smart-chat-stat-change .negative {
    color: #d63638;
}

.novera-smart-chat-stat-percentage {
    font-size: 12px;
    color: #646970;
}

/* Stats Grid */
.novera-smart-chat-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.novera-smart-chat-stats-widget {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.novera-smart-chat-stats-widget h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #1d2327;
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 10px;
}

.novera-smart-chat-stats-widget canvas {
    max-width: 100%;
    height: auto !important;
}

/* Tables */
.novera-smart-chat-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.novera-smart-chat-table-container table {
    margin: 0;
}

.novera-smart-chat-page-url {
    font-size: 12px;
    color: #646970;
    word-break: break-all;
}

/* Traffic Sources */
.novera-smart-chat-traffic-sources-list {
    margin-top: 15px;
}

.novera-smart-chat-source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.novera-smart-chat-source-item:last-child {
    border-bottom: none;
}

.novera-smart-chat-source-name {
    font-weight: 500;
    flex: 1;
}

.novera-smart-chat-source-clicks {
    font-weight: bold;
    margin-right: 10px;
}

.novera-smart-chat-source-percentage {
    font-size: 12px;
    color: #646970;
    min-width: 40px;
    text-align: right;
}

/* Working Hours Rows */
.working-hours-row {
    display: none;
}

/* Dashboard Widget */
.novera-smart-chat-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.novera-smart-chat-dashboard-stats .novera-smart-chat-stat-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.novera-smart-chat-dashboard-stats .novera-smart-chat-stat-item strong {
    display: block;
    font-size: 18px;
    color: #25D366;
    margin-bottom: 2px;
}

.novera-smart-chat-dashboard-stats .novera-smart-chat-stat-item span {
    font-size: 11px;
    color: #646970;
    text-transform: uppercase;
}

/* Support Widget */
.novera-smart-chat-support-widget {
    background: white;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    padding: 15px;
    border-radius: 4px;
}

.novera-smart-chat-support-widget h4 {
    margin: 0 0 10px 0;
    color: #1d2327;
}

.novera-smart-chat-support-widget p {
    margin: 0 0 15px 0;
    color: #646970;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1200px) {
    .novera-smart-chat-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .novera-smart-chat-admin-container {
        flex-direction: column;
    }
    
    .novera-smart-chat-sidebar {
        width: 100%;
    }
    
    .novera-smart-chat-tab-nav {
        flex-wrap: wrap;
    }
    
    .novera-smart-chat-tab-button {
        flex: 1;
        min-width: 120px;
    }
    
    .novera-smart-chat-stats-cards {
        grid-template-columns: 1fr;
    }
    
    .novera-smart-chat-filters form {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .novera-smart-chat-dashboard-stats {
        grid-template-columns: 1fr;
    }
}

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

.novera-smart-chat-tab-content.active {
    animation: fadeIn 0.3s ease;
}

.novera-smart-chat-stat-card {
    animation: fadeIn 0.5s ease;
}

/* Form Improvements */
.form-table th {
    width: 200px;
    padding: 15px 10px 15px 0;
}

.form-table td {
    padding: 15px 10px;
}

.form-table input[type="text"],
.form-table input[type="time"],
.form-table select,
.form-table textarea {
    transition: border-color 0.3s ease;
}

.form-table input[type="text"]:focus,
.form-table input[type="time"]:focus,
.form-table select:focus,
.form-table textarea:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 1px #25D366;
}

/* Color picker */
input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Success notices */
.notice.notice-success {
    border-left-color: #25D366;
}

/* Loading states */
.novera-smart-chat-loading {
    opacity: 0.6;
    pointer-events: none;
}

.novera-smart-chat-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #25D366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tracking examples styling */
.novera-smart-chat-tracking-examples {
    margin-top: 10px;
}

.novera-smart-chat-tracking-examples details {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.novera-smart-chat-tracking-examples summary {
    cursor: pointer;
    font-weight: 600;
    color: #0073aa;
    padding: 5px 0;
}

.novera-smart-chat-tracking-examples summary:hover {
    color: #005a87;
}

.novera-smart-chat-tracking-examples pre {
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0 0 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.4;
}

.novera-smart-chat-tracking-examples code {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    color: #d14;
}

/* Test button styling */
.novera-smart-chat-test-tracking {
    background: #0073aa !important;
    border-color: #0073aa !important;
    color: white !important;
}

.novera-smart-chat-test-tracking:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
}

/* Button utility classes */
.novera-smart-chat-test-button,
.novera-smart-chat-reset-button,
.novera-smart-chat-export-button,
.novera-smart-chat-import-button {
    margin-left: 10px;
}

/* Inline notices */
.notice.inline {
    margin: 5px 0;
    padding: 8px 12px;
}

/* Code textarea styling */
textarea.code {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    background: #f9f9f9;
    border: 1px solid #ddd;
}

/* Preview position classes */
.novera-smart-chat-preview-container.preview-bottom-right .novera-smart-chat-preview-button {
    margin-left: auto;
    margin-top: auto;
}

.novera-smart-chat-preview-container.preview-bottom-left .novera-smart-chat-preview-button {
    margin-right: auto;
    margin-top: auto;
}

.novera-smart-chat-preview-container.preview-top-right .novera-smart-chat-preview-button {
    margin-left: auto;
    margin-bottom: auto;
}

.novera-smart-chat-preview-container.preview-top-left .novera-smart-chat-preview-button {
    margin-right: auto;
    margin-bottom: auto;
}

/* Preview size variations */
.novera-smart-chat-preview-button.novera-smart-chat-small {
    padding: 8px 12px;
    font-size: 12px;
}

.novera-smart-chat-preview-button.novera-smart-chat-medium {
    padding: 10px 15px;
    font-size: 14px;
}

.novera-smart-chat-preview-button.novera-smart-chat-large {
    padding: 12px 18px;
    font-size: 16px;
}

/* Focus states for accessibility */
.novera-smart-chat-tab-button:focus {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

.novera-smart-chat-preview-button:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .novera-smart-chat-preview-button {
        border: 2px solid currentColor;
    }
    
    .novera-smart-chat-tab-button.active {
        background: #25D366;
        color: white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .novera-smart-chat-tab-button,
    .novera-smart-chat-preview-button,
    .novera-smart-chat-stat-card {
        transition: none;
    }
    
    .novera-smart-chat-tab-content.active {
        animation: none;
    }
    
    @keyframes spin {
        to {
            transform: none;
        }
    }
}