/**
 * InfoChat Admin Styles
 */

/* Settings Container */
.infochat-settings {
    max-width: 800px;
}

.infochat-settings-container {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-top: 20px;
}

.infochat-settings h2 {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.infochat-settings h2:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.infochat-settings .form-table th {
    width: 200px;
    padding-left: 0;
}

.infochat-settings .form-table td {
    padding-left: 0;
}

/* Color Picker */
.infochat-color-picker {
    width: 100px !important;
}

/* Leads Page */
.infochat-leads {
    margin-right: 20px;
}

.infochat-leads .lead-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.infochat-leads .status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.infochat-leads .status-contacted {
    background: #fff3e0;
    color: #f57c00;
}

.infochat-leads .status-qualified {
    background: #e8f5e9;
    color: #388e3c;
}

.infochat-leads .status-converted {
    background: #f3e5f5;
    color: #7b1fa2;
}

.infochat-leads .status-closed {
    background: #efebe9;
    color: #5d4037;
}

/* Chat History */
.infochat-history {
    margin-right: 20px;
}

/* Modal */
.infochat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.infochat-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.infochat-modal-content h2 {
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.infochat-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.infochat-modal-close:hover {
    color: #333;
}

.infochat-messages-container {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.infochat-messages-container .message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 80%;
}

.infochat-messages-container .message.user {
    background: #0073aa;
    color: #fff;
    margin-left: auto;
}

.infochat-messages-container .message.assistant {
    background: #f0f0f0;
    color: #333;
}

.infochat-messages-container .message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.infochat-messages-container .message.user .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Context Page */
.infochat-context {
    margin-right: 20px;
}

.infochat-context-actions {
    margin: 20px 0;
}

.infochat-context-actions .spinner {
    visibility: hidden;
    margin-left: 10px;
}

.infochat-context-actions .spinner.is-active {
    visibility: visible;
}

/* Dashboard Widget */
.infochat-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.infochat-stat-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.infochat-stat-box .stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #0073aa;
}

.infochat-stat-box .stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Tables */
.infochat-leads table,
.infochat-history table,
.infochat-context table {
    margin-top: 15px;
}

/* Action Links */
.infochat-leads a,
.infochat-history a,
.infochat-context a {
    text-decoration: none;
}

.infochat-leads a:hover,
.infochat-history a:hover,
.infochat-context a:hover {
    text-decoration: underline;
}

/* Notice */
.infochat-notice {
    background: #fff;
    border-left: 4px solid #0073aa;
    padding: 12px;
    margin: 20px 0;
}

.infochat-notice.success {
    border-left-color: #46b450;
}

.infochat-notice.error {
    border-left-color: #dc3232;
}

/* Stats Cards */
.infochat-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.infochat-stats-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}

.infochat-stats-card .number {
    font-size: 32px;
    font-weight: 600;
    color: #0073aa;
}

.infochat-stats-card .label {
    color: #666;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 782px) {
    .infochat-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .infochat-settings .form-table th {
        width: 100%;
        display: block;
    }
}

/* CRM Features Page */
.infochat-crm-features {
    max-width: 1000px;
    margin: 0 auto;
}

.infochat-crm-features > h1 {
    display: none;
}

/* Hero Section */
.infochat-crm-hero {
    background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 40%, #0073aa 100%);
    border-radius: 16px;
    padding: 50px 48px 44px;
    margin: 20px 0 0;
    color: #fff;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.infochat-crm-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.infochat-crm-hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(240,195,60,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.infochat-crm-hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f0c33c, #e6a817);
    color: #1a1a2e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.infochat-crm-features > h1 {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    white-space: nowrap;
}

.infochat-crm-hero-title {
    color: #fff !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    line-height: 1.3;
    position: relative;
    z-index: 1;
    border: none !important;
}

.infochat-crm-hero-desc {
    font-size: 16px;
    line-height: 1.7;
    margin: 0 auto 28px;
    opacity: 0.9;
    max-width: 640px;
    position: relative;
    z-index: 1;
}

.infochat-crm-hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.infochat-crm-hero-sub {
    font-size: 13px;
    opacity: 0.6;
    margin: 18px 0 0;
    position: relative;
    z-index: 1;
}

/* Buttons */
.infochat-btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, #f0c33c, #e6a817);
    color: #1a1a2e !important;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(240,195,60,0.3);
}

.infochat-btn-primary:hover,
.infochat-btn-primary:focus {
    background: linear-gradient(135deg, #e6b82e, #d4a010);
    color: #1a1a2e !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(240,195,60,0.4);
    text-decoration: none !important;
}

.infochat-btn-lg {
    font-size: 17px;
    padding: 16px 40px;
}

.infochat-btn-outline {
    display: inline-block;
    background: transparent;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    padding: 13px 32px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.35);
    text-decoration: none !important;
    transition: all 0.25s ease;
    cursor: pointer;
}

.infochat-btn-outline:hover,
.infochat-btn-outline:focus {
    border-color: #fff;
    background: rgba(255,255,255,0.1);
    color: #fff !important;
    text-decoration: none !important;
}

/* Stats Bar */
.infochat-crm-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin: -28px 32px 32px;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.infochat-crm-stat {
    padding: 24px 16px;
    text-align: center;
    border-right: 1px solid #f0f0f0;
}

.infochat-crm-stat:last-child {
    border-right: none;
}

.infochat-crm-stat-num {
    display: block;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #0073aa, #00a0d2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.infochat-crm-stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-weight: 500;
}

/* Section Title */
.infochat-crm-section-title {
    text-align: center;
    margin: 40px 0 28px;
}

.infochat-crm-section-title h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.infochat-crm-section-title p {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* Feature Cards Grid */
.infochat-crm-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 0 0 36px;
}

.infochat-crm-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 28px 22px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.infochat-crm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.infochat-crm-card:hover {
    border-color: #0073aa;
    box-shadow: 0 8px 30px rgba(0,115,170,0.12);
    transform: translateY(-4px);
}

.infochat-crm-card:hover::before {
    opacity: 1;
}

.infochat-crm-card-accent {
    border-color: #25D366;
    background: linear-gradient(180deg, #f0faf4 0%, #fff 40%);
}

.infochat-crm-card-accent::before {
    background: linear-gradient(90deg, #25D366, #128C7E) !important;
}

.infochat-crm-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.infochat-crm-card-icon .dashicons {
    font-size: 26px;
    width: 26px;
    height: 26px;
}

.infochat-crm-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 10px;
}

.infochat-crm-card h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}

.infochat-crm-card p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

/* Integration Note */
.infochat-crm-integration-note {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #f0f6fc, #e8f4fd);
    border: 1px solid #c3daf0;
    border-left: 5px solid #0073aa;
    border-radius: 12px;
    padding: 24px 28px;
    margin: 0 0 36px;
}

.infochat-crm-integration-icon {
    width: 48px;
    height: 48px;
    background: #0073aa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.infochat-crm-integration-icon .dashicons {
    color: #fff;
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.infochat-crm-integration-text h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}

.infochat-crm-integration-text p {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.infochat-crm-integration-text a {
    color: #0073aa;
    font-weight: 600;
}

/* Footer CTA */
.infochat-crm-footer {
    text-align: center;
    background: linear-gradient(180deg, #f8f9fa, #edf2f7);
    border-radius: 16px;
    padding: 44px 32px;
    margin-bottom: 20px;
}

.infochat-crm-footer h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.infochat-crm-footer > p {
    font-size: 15px;
    color: #666;
    margin: 0 0 24px;
}

/* Coupon Code */
.infochat-crm-coupon {
    background: #fff;
    border: 2px dashed #f0c33c;
    border-radius: 12px;
    padding: 24px 32px;
    margin: 0 auto 28px;
    max-width: 420px;
    position: relative;
}

.infochat-crm-coupon-tag {
    display: inline-block;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 4px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.infochat-crm-coupon-text {
    font-size: 13px;
    color: #555;
    margin: 0 0 14px;
    line-height: 1.5;
}

.infochat-crm-coupon-code {
    display: inline-block;
    background: linear-gradient(135deg, #1a1a2e, #2d2d44);
    color: #f0c33c;
    font-size: 22px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    padding: 12px 28px;
    border-radius: 8px;
    margin-bottom: 12px;
    user-select: all;
}

.infochat-crm-coupon-copy {
    display: block;
    margin: 0 auto;
    background: none;
    border: 1px solid #0073aa;
    color: #0073aa;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.infochat-crm-coupon-copy:hover {
    background: #0073aa;
    color: #fff;
}

/* Responsive */
@media (max-width: 1100px) {
    .infochat-crm-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 782px) {
    .infochat-crm-hero {
        padding: 32px 24px 28px;
    }

    .infochat-crm-hero-title {
        font-size: 24px !important;
    }

    .infochat-crm-stats-bar {
        grid-template-columns: repeat(2, 1fr);
        margin: -20px 16px 24px;
    }

    .infochat-crm-stat {
        border-bottom: 1px solid #f0f0f0;
    }

    .infochat-crm-stat:nth-child(2) {
        border-right: none;
    }

    .infochat-crm-grid {
        grid-template-columns: 1fr;
    }

    .infochat-crm-footer {
        padding: 32px 20px;
    }
}
