/* WP Customer Service CRM Frontend Portal CSS */
.crm-portal-wrapper {
    max-width: 1000px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #0f172a;
}

.portal-header-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-radius: 20px;
    padding: 36px 30px;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
    margin-bottom: 30px;
}

.portal-header-card h1,
.portal-header-card h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 800;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.portal-header-card p {
    margin: 0 0 24px 0;
    color: #cbd5e1 !important;
    font-size: 14px;
}

.portal-search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
}

.portal-search-box input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.portal-btn-primary, .portal-btn-submit {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.portal-btn-primary:hover, .portal-btn-submit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.portal-results-area {
    margin-bottom: 30px;
}

.portal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}

.portal-card h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.flex-between {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.portal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .form-grid-2col { grid-template-columns: 1fr; }
    .portal-search-box { flex-direction: column; }
}

.portal-ticket-form .form-group {
    margin-bottom: 16px;
}

.portal-ticket-form label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.portal-ticket-form input[type="text"],
.portal-ticket-form input[type="email"],
.portal-ticket-form input[type="search"],
.crm-portal-wrapper input[type="text"],
.crm-portal-wrapper input[type="email"] {
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    line-height: 1.4 !important;
    padding: 10px 14px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
}

.portal-ticket-form select,
.crm-portal-wrapper select {
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    line-height: 1.4 !important;
    padding: 10px 14px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
}

.portal-ticket-form textarea,
.portal-reply-text {
    width: 100% !important;
    padding: 12px 14px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important;
}

.portal-ticket-form input:focus,
.portal-ticket-form select:focus,
.portal-ticket-form textarea:focus,
.portal-reply-text:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-table th, .portal-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    text-align: left;
}

.portal-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #475569;
}

.portal-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.5px;
}

.badge-active, .badge-resolved { background: #dcfce7; color: #15803d; }
.badge-open, .badge-expired { background: #fee2e2; color: #b91c1c; }
.badge-in_progress { background: #dbeafe; color: #1d4ed8; }
.badge-closed, .badge-cancelled { background: #f1f5f9; color: #64748b; }

.portal-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.portal-bubble {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
}

.bubble-admin {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.bubble-customer {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

.bubble-sender {
    font-size: 11px;
    margin-bottom: 4px;
    opacity: 0.85;
}

.portal-alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 20px;
}

.portal-alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.portal-alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

.portal-loading {
    text-align: center;
    padding: 30px;
    font-weight: 600;
    color: #64748b;
}

.portal-btn-sm {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.portal-btn-sm:hover {
    background: #e2e8f0;
}

/* Pricing Cards */
.crm-services-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.pricing-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgba(0,0,0,0.08);
}

.pricing-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.pricing-header .price {
    font-size: 26px;
    font-weight: 800;
    color: #2563eb;
    margin: 12px 0;
}

.pricing-header .price span {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.pricing-desc {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.pricing-btn {
    background: #0f172a;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pricing-btn:hover {
    background: #1e293b;
}

/* Floating Customer Support Button */
#crm-floating-support-btn {
    position: fixed !important;
    bottom: 85px !important;
    right: 20px !important;
    z-index: 999999 !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    padding: 12px 20px !important;
    border-radius: 50px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.45) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    line-height: 1 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
}

#crm-floating-support-btn:hover {
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.6) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Responsive Mobile & Tablet Optimizations */
@media (max-width: 768px) {
    .crm-portal-wrapper {
        padding: 10px;
    }

    .portal-search-box {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .portal-search-box input[type="text"] {
        width: 100% !important;
    }

    .portal-search-box button {
        width: 100% !important;
    }

    .form-grid-2col {
        grid-template-columns: 1fr !important;
    }

    .portal-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .portal-table {
        min-width: 600px;
    }

    #crm-floating-support-btn {
        bottom: 75px !important;
        right: 15px !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .portal-header-card h1 {
        font-size: 20px !important;
    }

    .portal-card {
        padding: 16px !important;
    }
}


