.linkmaster-overview {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background-color: white;
    border: 1px solid #dcdcde;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.linkmaster-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-card {
    background: white;
    border-radius: 4px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    border: 1px solid #dcdcde;
    min-height: 120px;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.stats-card h3 {
    margin: 0 0 12px 0;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border-bottom: none;
    padding-bottom: 0;
    position: relative;
    display: inline-block;
}

.stats-number {
    font-size: 30px;
    font-weight: 700;
    color: #2271b1;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stats-number.positive {
    color: #00a32a;
    display: flex;
    align-items: center;
}

.stats-number.positive:before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #00a32a;
    margin-right: 8px;
}

.stats-number.negative {
    color: #cc1818;
    display: flex;
    align-items: center;
}

.stats-number.negative:before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid #cc1818;
    margin-right: 8px;
}

/* Trend indicators */
.stats-trend {
    display: flex;
    align-items: center;
    font-size: 13px;
    margin-top: 4px;
}

.stats-trend.positive {
    color: #00a32a;
}

.stats-trend.negative {
    color: #cc1818;
}

.trend-icon {
    font-size: 16px;
    margin-right: 2px;
}

.trend-value {
    font-weight: 600;
    margin-right: 4px;
}

.trend-label {
    color: #646970;
    font-size: 11px;
}

.stats-detail {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.stats-url {
    font-size: 14px;
    color: #2271b1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(34, 113, 177, 0.08);
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
}

.stats-subtext {
    font-size: 12px;
    color: #646970;
    margin-top: 4px;
    line-height: 1.4;
}

.linkmaster-chart-container {
    background: white;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    border: 1px solid #dcdcde;
}

.linkmaster-chart-container:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

#chart-wrapper {
    position: relative;
    height: 350px;
    margin-top: 16px;
}

#clicks-chart {
    max-height: 350px;
    width: 100% !important;
    margin: 0 auto;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: none;
    padding-bottom: 0;
}

.chart-header h3 {
    margin: 0;
    color: #3c4043;
    font-size: 20px;
    font-weight: 600;
    position: relative;
    padding-left: 0;
    letter-spacing: 0.3px;
}

.linkmaster-header {
    margin-bottom: 24px;
    text-align: left;
    padding: 0 0 16px 0;
    border-bottom: 1px solid #dcdcde;
}

.linkmaster-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px 0;
}

.linkmaster-subtitle {
    font-size: 14px;
    color: #646970;
    margin: 0;
}

.chart-actions {
    display: flex;
    justify-content: flex-end;
}

.chart-type-toggle {
    display: flex;
    gap: 4px;
}

.chart-type-btn {
    background: #f6f7f7;
    color: #50575e;
    border: 1px solid #dcdcde;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.chart-type-btn.active {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

/* Click Sources Styles */
.linkmaster-sources-container {
    background: white;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    border: 1px solid #dcdcde;
}

.sources-header {
    margin-bottom: 16px;
}

.sources-header h3 {
    margin: 0;
    color: #3c4043;
    font-size: 20px;
    font-weight: 600;
    position: relative;
    padding-left: 0;
    letter-spacing: 0.3px;
}

.referrers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.referrer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background-color: #f6f7f7;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.referrer-item:hover {
    background-color: #f0f0f1;
}

.referrer-url {
    font-size: 14px;
    color: #2271b1;
    font-weight: 500;
}

.referrer-count {
    font-size: 14px;
    font-weight: 600;
    color: #3c4043;
    background-color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    min-width: 40px;
    text-align: center;
}

.no-data {
    color: #646970;
    font-style: italic;
    padding: 10px 0;
    margin-bottom: 5px;
}

.sample-note {
    color: #646970;
    font-size: 13px;
    margin-bottom: 15px;
}

.sample-data .referrers-list.sample {
    opacity: 0.7;
}

.referrer-item.sample {
    background-color: #f0f0f1;
}

.chart-type-btn:hover:not(.active) {
    background: #f0f0f1;
    border-color: #c5c5c5;
}

/* Modal Styles */
.linkmaster-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 100000;
}

.linkmaster-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5vh auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.linkmaster-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.linkmaster-modal-header h2 {
    margin: 0;
    font-size: 1.3em;
    line-height: 1.4;
}

.linkmaster-modal-body {
    padding: 20px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.close-modal {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 24px;
    color: #646970;
    line-height: 1;
}

.close-modal:hover {
    color: #135e96;
}

/* Table Styles */
.column-clicks,
.column-percentage {
    width: 100px;
    text-align: right !important;
}

.linkmaster-modal-body table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 10px;
}

.linkmaster-modal-body th {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #c3c4c7;
}

.linkmaster-modal-body td {
    padding: 12px 10px;
    vertical-align: middle;
}

.linkmaster-modal-body tr:nth-child(odd) {
    background-color: #f6f7f7;
}

.linkmaster-modal-body tr:hover {
    background-color: #f0f0f1;
}

/* Chart Loading Indicator */
.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 12px;
}

.chart-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(34, 113, 177, 0.2);
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

.chart-loading span {
    color: #1d2327;
    font-size: 14px;
    font-weight: 500;
}

/* Chart Type Toggle */
.chart-type-toggle {
    display: flex;
    gap: 8px;
}

.chart-type-btn {
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #50575e;
}

.chart-type-btn:hover {
    background: #f6f7f7;
    border-color: #8c8f94;
}

.chart-type-btn.active {
    background: #2271b1;
    color: white;
    border-color: #135e96;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Custom No Data Message */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
    font-size: 16px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    margin: 20px 0;
    border: 1px dashed rgba(0,0,0,0.1);
}

.no-data:before {
    content: '📊';
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
    .linkmaster-stats-cards {
        grid-template-columns: 1fr;
    }
    
    .stats-number {
        font-size: 28px;
    }
    
    .linkmaster-chart-container {
        height: 500px;
        padding: 20px;
    }
    
    #chart-wrapper {
        height: 450px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .chart-header .view-all-stats {
        margin-left: 0 !important;
    }
    
    .chart-type-toggle {
        margin-top: 8px;
    }
}

/* Pagination Styles */
.linkmaster-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 15px 0;
    color: #646970;
    font-size: 13px;
}

.linkmaster-pagination.top {
    margin-bottom: 20px;
}

.linkmaster-pagination.bottom {
    margin-top: 20px;
}

.linkmaster-pagination .displaying-num {
    margin-right: 10px;
}

.linkmaster-pagination .pagination-links {
    display: flex;
    align-items: center;
}

.linkmaster-pagination .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    margin: 0 3px;
    padding: 0 5px;
    border-radius: 3px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    color: #2c3338;
    text-decoration: none;
    font-size: 16px;
}

.linkmaster-pagination .button:hover:not(.disabled) {
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #1d2327;
}

.linkmaster-pagination .button.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.linkmaster-pagination .paging-info {
    margin: 0 10px;
    font-size: 13px;
    color: #646970;
}

.linkmaster-detailed-stats {
    padding: 0;
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 0;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 20px;
    border: 1px solid #dcdcde;
}

.linkmaster-detailed-stats table {
    margin-top: 0;
    border-collapse: collapse;
    width: 100%;
}

.tablenav {
    height: auto;
    margin: 30px 0 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.tablenav-pages {
    float: right;
    margin: 0 0 9px;
    text-align: right;
}

.tablenav .tablenav-pages a,
.tablenav-pages span.current-page {
    display: inline-block;
    min-width: 30px;
    min-height: 30px;
    margin: 0 0 0 2px;
    padding: 0 4px;
    font-size: 13px;
    line-height: 28px;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
}

.tablenav-pages .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    margin: 0 0 0 2px;
    padding: 0 4px;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 4px;
    border: 1px solid #8c8f94;
    background: #f6f7f7;
    color: #2c3338;
}

.tablenav-pages .button[aria-disabled="true"] {
    color: #a7aaad;
    border-color: #dcdcde;
    background: #f6f7f7;
    cursor: default;
    pointer-events: none;
}

.tablenav-pages .button:hover:not([aria-disabled="true"]) {
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #2c3338;
}

.paging-input {
    margin: 0 6px;
    font-size: 13px;
}

.current-page {
    padding: 3px 5px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    min-width: 30px;
    display: inline-block;
    text-align: center;
}

.tablenav-paging-text {
    font-size: 13px;
    color: #646970;
}

.nav-tab .dashicons {
    margin-right: 8px;
    font-size: 16px;
    line-height: 1.3;
}

.nav-tab-active .dashicons {
    color: #2271b1;
}

@media screen and (max-width: 782px) {
    .linkmaster-overview {
        padding: 0;
        margin: 10px;
    }
    
    .linkmaster-header {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .linkmaster-stats-cards {
        grid-template-columns: 1fr;
    }
    
    .linkmaster-chart-container {
        height: 300px;
    }
    
    #clicks-chart {
        max-height: 250px;
    }

    .linkmaster-modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .linkmaster-modal-body {
        max-height: calc(100vh - 120px);
    }

    .column-clicks,
    .column-percentage {
        width: 70px;
    }

    .tablenav {
        margin: 15px 0 5px;
    }
    
    .tablenav-pages {
        float: none;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .tablenav .tablenav-pages a,
    .tablenav-pages span.current-page {
        min-width: 36px;
        min-height: 36px;
        line-height: 34px;
        font-size: 14px;
    }
    
    .paging-input {
        margin: 0 4px;
        font-size: 14px;
    }
}

/* Chart glow effects */
.chart-container {
    position: relative;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.1));
}

.chart-container canvas {
    filter: drop-shadow(0 0 8px rgba(43, 108, 176, 0.4)) 
           drop-shadow(0 0 8px rgba(255, 159, 28, 0.4))
           drop-shadow(0 0 8px rgba(255, 77, 109, 0.4))
           drop-shadow(0 0 8px rgba(76, 201, 192, 0.4))
           drop-shadow(0 0 8px rgba(74, 222, 128, 0.4));
}

/* Enhance chart colors */
.chart-container .chartjs-render-monitor {
    animation: chartFadeIn 0.5s ease-in-out;
}

@keyframes chartFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Enhance legend items */
.chart-container .chartjs-legend li span {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}
