/**
 * ABMsense notifications
 * Modern, professional notifications design with custom lead scoring colors
 */

/* Main notifications Layout */
.abmsense-notifications {
    margin: 20px 0;
    color: #2d3748;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #f4f6f8;
}

/* Header */
.abmsense-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.abmsense-header h1 {
    margin: 0;
    padding: 0;
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
}

.abmsense-beta-badge {
    font-size: 12px;
    font-weight: 600;
    background: #e2e8f0;
    color: #4a5568;
    border-radius: 4px;
    padding: 2px 8px;
    margin-left: 10px;
    text-transform: uppercase;
}

.abmsense-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#abmsense-refresh-data {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #edf2f7;
    border: 1px solid #cbd5e0;
    color: #4a5568;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    height: 40px;
    box-sizing: border-box;
}

#abmsense-refresh-data i {
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
}

#abmsense-refresh-data:hover,
.settings-button:hover {
    background-color: #e2e8f0;
    border-color: #a0aec0;
    color: #2d3748;
}

#abmsense-refresh-data i, .settings-button i {
    margin-right: 6px;
}

.settings-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #fff;
    border: 1px solid #3182ce;
    color: #3182ce;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    height: 40px;
    box-sizing: border-box;
    vertical-align: middle;
    line-height: 1;
}

.settings-button i {
    font-size: 16px;
    vertical-align: middle;
    line-height: 1;
    display: inline-block;
}

.settings-button:hover {
    background-color: #e2e8f0;
    color: #4a5568;
}

/* Main Content Cards */
.abmsense-card, .abmsense-info-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.abmsense-card-header, .abmsense-info-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.abmsense-card-header h2, .abmsense-info-card-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.abmsense-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.abmsense-card-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    height: auto;
    line-height: 1.4;
}

.abmsense-card-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.abmsense-card-actions .button.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

#abmsense-export-data {
    margin-left: auto;
    background: #fff;
    border-color: #2271b1;
    color: #2271b1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    height: auto;
    line-height: 1.4;
}

#abmsense-export-data .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

#abmsense-export-data:hover {
    background: #2271b1;
    color: #fff;
}

.abmsense-card-body {
    padding: 0;
}

.abmsense-info-card-body {
    padding: 24px;
}

.abmsense-info-card-body p {
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.abmsense-info-card-body ul {
    margin: 0 0 20px 0;
    padding-left: 24px;
}

.abmsense-info-card-body li {
    margin-bottom: 12px;
    line-height: 1.6;
    display: flex;
    align-items: center;
}

/* Table Styles */
.abmsense-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.abmsense-table th {
    background-color: #f8fafc;
    font-weight: 500;
    text-align: left;
    padding: 12px 24px;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

/* Sortable Headers */
.abmsense-table th.sortable {
    cursor: pointer;
    padding-right: 32px;
    user-select: none;
}

.abmsense-table th.sortable:hover {
    background-color: #f1f5f9;
}

.sort-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    transition: opacity 0.2s;
}

.sortable:hover .sort-indicator {
    opacity: 0.7;
}

.sort-indicator.dashicons-arrow-up-alt2,
.sort-indicator.dashicons-arrow-down-alt2 {
    opacity: 1;
    color: #4a5568;
}

/* Active sort column */
.abmsense-table th.sort-asc .sort-indicator {
    opacity: 1;
}

.abmsense-table th.sort-desc .sort-indicator {
    opacity: 1;
}

.abmsense-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    color: #2d3748;
    font-size: 14px;
}

.abmsense-table tr:last-child td {
    border-bottom: none;
}

.abmsense-table tr:hover {
    background-color: #f8fafc;
}

/* Updated Lead Score Styles */
.abmsense-lead-score {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.abmsense-lead-score.hot {
    background-color: rgba(229, 62, 62, 0.1);
    color: #E53E3E;
}

.abmsense-lead-score.warm {
    background-color: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.abmsense-lead-score.cold {
    background-color: #D0E7FF;
    color: #004080;
}

.abmsense-progress {
    height: 8px;
    width: 100%;
    background-color: #edf2f7;
    border-radius: 4px;
    overflow: hidden;
}

.abmsense-progress-bar {
    height: 100%;
    border-radius: 4px;
}

.abmsense-progress-bar.hot {
    background-color: #e53e3e; /* Red */
}

.abmsense-progress-bar.medium {
    background-color: #f59e0b; /* Orange */
}

.abmsense-progress-bar.low {
    background-color: #10b981; /* Green */
}

/* Rank indicators */
.rank-number {
    font-weight: 600;
    font-size: 16px;
}

.rank-number.top-3 {
    color: #1a56db;
    font-size: 18px;
}

/* Loading Overlay */
#abmsense-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.abmsense-loader {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #1a56db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Placeholder styling */
.abmsense-placeholder-row td {
    text-align: center;
    color: #718096;
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
    .abmsense-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .abmsense-header-actions {
        margin-top: 16px;
        width: 100%;
        justify-content: space-between;
    }
}

/* Demo data notice */
.abmsense-notice {
    background-color: #f8fafc;
    border-left: 4px solid #3182ce;
    border-radius: 8px;
    padding: 20px 28px;
    margin: 32px 0 0 0;
    font-size: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    max-width: 700px;
}

.abmsense-notice strong {
    font-size: 16px;
    color: #2b6cb0;
    display: block;
    margin-bottom: 6px;
}

.abmsense-notice ul {
    margin: 0;
    padding-left: 20px;
}

.abmsense-notice li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Force left-to-right text direction */
.abmsense-notifications,
.abmsense-notifications * {
    direction: ltr !important;
    text-align: left !important;
}

.abmsense-table th,
.abmsense-table td {
    text-align: left !important;
    direction: ltr !important;
}

/* Only align lead scores to center */
.abmsense-lead-score {
    text-align: center !important;
}

/* Stats Boxes Container */
.abmsense-stats-container {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

/* Total Companies Box */
.abmsense-total-companies-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

/* Identified Companies specific styles */
.abmsense-companies-icon .dashicons-building {
    color: #4c9fa5;
}

/* Hot Companies Box */
.hot-companies-box {
    background-color: #fee2e2;
    border: 1px solid #fee2e2;
}

.hot-companies-box .hot-emoji {
    font-size: 36px;
    line-height: 1;
}

.hot-companies-box .abmsense-total-count {
    color: #b91c1c;
}

/* Average Engagement Score Box */
.avg-score-box {
    background: #fff;
    border: none;
}

.avg-score-box .abmsense-companies-icon .dashicons {
    color: #9940a1;
}

.abmsense-companies-icon {
    margin-bottom: 10px;
}

.abmsense-companies-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
}

.abmsense-total-count-label {
    font-size: 16px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 10px;
    text-align: center;
    white-space: nowrap;
}

.abmsense-total-count {
    font-size: 42px;
    font-weight: 700;
    color: #030b1d;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

/* Time Period Selector */
.abmsense-time-period-container {
    background: transparent;              /* match main background */
    box-shadow: none;                     /* remove the card-like shadow */
    padding: 0;                           /* remove inner spacing */
    margin: 16px 0 24px 0;                /* spacing between header and card */
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.abmsense-time-period-container label {
    font-weight: 500;
    margin-right: 10px;
    color: #2d3748; /* darker gray to match header */
}

.abmsense-time-period-container select {
    padding: 6px 24px 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background-color: white;
    color: #4a5568;
    font-weight: 500;
    min-width: 150px;
}

/* Main Header (on main background) */
.abmsense-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.abmsense-main-title h1 {
    margin: 0;
    padding: 0;
    font-size: 23px;
    font-weight: 400;
    line-height: 1.3;
    display: flex;
    align-items: center;
}

.abmsense-main-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Building icon above Identified Companies */
.abmsense-companies-icon {
    margin-bottom: 10px;
}

.abmsense-companies-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
}

/* Specific icon colors */
.abmsense-companies-icon .dashicons-building {
    color: #4c9fa5;
}

.avg-score-box .abmsense-companies-icon .dashicons {
    color: #9940a1;
}

/* Lead Scoring Card - Make it wider */
.lead-scoring-card {
    width: 100%;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .abmsense-main-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .abmsense-main-controls {
        margin-top: 16px;
        flex-wrap: wrap;
        width: 100%;
    }
    
    .abmsense-time-period-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    margin: 16px 0 24px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    }
    
    .abmsense-stats-container {
        flex-direction: column;
    }
    
    .abmsense-total-companies-box {
        max-width: none;
    }
}

/* Pagination Styles */
.abmsense-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.abmsense-pagination-info {
    color: #4a5568;
    font-size: 14px;
}

.abmsense-pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.abmsense-pagination-controls .button {
    padding: 6px 10px;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.abmsense-pagination-controls .button:hover:not(:disabled) {
    background-color: #f8fafc;
    border-color: #cbd5e0;
}

.abmsense-pagination-controls .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.abmsense-pagination-controls .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: block;
}

.abmsense-page-info {
    color: #4a5568;
    font-size: 14px;
    padding: 0 8px;
}

@media screen and (max-width: 782px) {
    .abmsense-pagination {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        text-align: center;
    }
}

/* Search and Filter Controls */
.abmsense-table-controls {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background-color: #fff;
}

.abmsense-search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.abmsense-search-box .dashicons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    font-size: 16px;
}

.abmsense-search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    color: #2d3748;
    background-color: #f8fafc;
}

.abmsense-search-box input:focus {
    outline: none;
    border-color: #4c9fa5;
    box-shadow: 0 0 0 2px rgba(76, 159, 165, 0.1);
}

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

.abmsense-filters select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    color: #2d3748;
    background-color: #f8fafc;
    cursor: pointer;
    min-width: 140px;
}

.abmsense-filters select:focus {
    outline: none;
    border-color: #4c9fa5;
    box-shadow: 0 0 0 2px rgba(76, 159, 165, 0.1);
}

/* Responsive adjustments for search and filters */
@media screen and (max-width: 782px) {
    .abmsense-table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .abmsense-search-box {
        max-width: none;
    }

    .abmsense-filters {
        flex-direction: column;
    }
}

/* LinkedIn Button Styles */
.linkedin-profile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #0077b5;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    width: auto;
    margin: 0 auto;
    cursor: pointer;
}

.linkedin-profile-link,
.linkedin-profile-link *,
.linkedin-profile-link span,
.linkedin-profile-link .dashicons {
    color: #ffffff !important;
    text-decoration: none;
}

.linkedin-profile-link:hover {
    background: #005582;
}

/* Table LinkedIn button styles */
.abmsense-table .abmsense-linkedin-link {
    background: transparent;
    color: #2d3748;  /* Regular text color */
    border: none;
    padding: 4px 8px;
    height: auto;
    font-size: 13px;
    text-decoration: none;
}

.abmsense-table .abmsense-linkedin-link:hover {
    background: transparent;
    color: #2d3748;  /* Keep same color on hover */
    border: none;
    text-decoration: none;
}

.abmsense-table .abmsense-linkedin-link.disabled {
    background: transparent;
    color: #94a3b8;  /* Keep the disabled state lighter */
    border: none;
    text-decoration: none;
}

.abmsense-table .abmsense-linkedin-link.disabled:hover {
    background: transparent;
    color: #94a3b8;
    border: none;
    text-decoration: none;
}

/* Modal Styles */
.abmsense-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow-y: auto;
    padding: 40px 20px;
}

.abmsense-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.abmsense-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.abmsense-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
}

.abmsense-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    font-size: 24px;
    color: #4a5568;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.abmsense-modal-close:hover {
    background-color: #e2e8f0;
}

.abmsense-modal-body {
    padding: 32px;
}

/* Form Styles */
.abmsense-form-group {
    margin-bottom: 24px;
}

.abmsense-form-group:last-child {
    margin-bottom: 0;
}

.abmsense-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3748;
    font-size: 14px;
}

.abmsense-form-group input[type="text"],
.abmsense-form-group input[type="email"],
.abmsense-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    color: #2d3748;
    background-color: #fff;
    transition: all 0.2s;
    height: 42px;
}

.abmsense-form-group input[type="text"]:focus,
.abmsense-form-group input[type="email"]:focus,
.abmsense-form-group select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.abmsense-form-group select {
    padding-right: 36px;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 9l3 3 3-3" stroke="%234A5568" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.abmsense-form-group button[type="submit"] {
    background: #2b6cb0;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    height: 42px;
    line-height: 1;
}

.abmsense-form-group button[type="submit"]:hover {
    background: #2c5282;
}

.abmsense-form-group button[type="submit"]:disabled {
    background: #90cdf4;
    cursor: not-allowed;
}

#abmsense-form-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

#abmsense-form-message.success {
    background-color: #f0fff4;
    color: #2f855a;
    border: 1px solid #c6f6d5;
}

#abmsense-form-message.error {
    background-color: #fff5f5;
    color: #c53030;
    border: 1px solid #fed7d7;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .abmsense-modal {
        padding: 20px;
    }
    
    .abmsense-modal-header {
        padding: 20px 24px;
    }
    
    .abmsense-modal-body {
        padding: 24px;
    }
    
    .abmsense-form-group {
        margin-bottom: 20px;
    }
}

.company-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.company-row:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.company-row:active {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Button Group Styles */
.abmsense-button-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.abmsense-button-group button {
    padding: 6px 12px;
    height: auto;
    line-height: 1.4;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.2s;
}

.abmsense-edit-user {
    background: #fff !important;
    border: 1px solid #4299e1 !important;
    color: #4299e1 !important;
}

.abmsense-edit-user:hover {
    background: #ebf8ff !important;
    border-color: #2b6cb0 !important;
    color: #2b6cb0 !important;
}

.abmsense-toggle-state {
    background: #fff !important;
    border: 1px solid #e53e3e !important;
    color: #e53e3e !important;
}

.abmsense-toggle-state:hover {
    background: #fff5f5 !important;
    border-color: #c53030 !important;
    color: #c53030 !important;
}