/**
 * Admin styles for Smart Click Tracker.
 *
 * @package    Smart_Click_Tracker
 * @subpackage Smart_Click_Tracker/admin/css
 */

/* Common Styles */
.sct-dashboard-wrap {
    margin: 20px 20px 20px 0;
}

/* Header */
.sct-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border-radius: 8px;
    padding: 20px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sct-header .sct-heading {
    color: #fff;
    margin: 0;
    padding: 0;
    font-size: 24px;
}

.sct-header-description {
    margin: 5px 0 0;
    opacity: 0.9;
}

.sct-header-actions {
    display: flex;
    gap: 10px;
}

.sct-header-actions .button {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sct-header-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Dashboard */
.sct-dashboard {
    margin-top: 20px;
}

/* Empty State */
.sct-empty-state {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px 20px;
    text-align: center;
    margin: 20px 0;
}

.sct-empty-state-icon {
    margin-bottom: 20px;
}

.sct-empty-state-icon .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #2271b1;
}

.sct-empty-state h2 {
    margin-top: 0;
    font-size: 24px;
}

.sct-empty-state p {
    font-size: 16px;
    max-width: 600px;
    margin: 10px auto;
}

.sct-empty-state .button-hero {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Overview Cards */
.sct-overview-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.sct-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.sct-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sct-card-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #fff;
}

.sct-card-icon.total-clicks {
    background-color: #2271b1;
}

.sct-card-icon.unique-users {
    background-color: #46b450;
}

.sct-card-icon.last-24h {
    background-color: #ffb900;
}

.sct-card-icon.most-active {
    background-color: #dc3232;
}

.sct-card-content {
    flex-grow: 1;
}

.sct-card-content h3 {
    margin: 0 0 5px;
    font-size: 14px;
    color: #50575e;
}

.sct-card-value {
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
    word-break: break-word;
    line-height: 1.3;
}

/* Special styling for date range card */
.sct-card-icon.last-24h + .sct-card-content .sct-card-value {
    font-size: 16px;
}

.sct-card-subvalue {
    display: block;
    font-size: 14px;
    font-weight: normal;
    color: #50575e;
    margin-top: 2px;
}

/* Section Headers */
.sct-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sct-section-header h2 {
    margin: 0;
    font-size: 18px;
}

.sct-section-actions {
    display: flex;
    gap: 10px;
}

.sct-section-actions .button {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sct-section-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Table Styles */
.sct-table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.sct-trackers-table {
    border: none;
    border-collapse: collapse;
}

.sct-trackers-table th {
    background-color: #f9f9f9;
    border-bottom: 1px solid #e2e4e7;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.sct-trackers-table td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f1;
}

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

.column-name {
    width: 25%;
}

.column-selector {
    width: 25%;
}

.column-clicks {
    width: 15%;
}

.column-created {
    width: 15%;
}

.column-actions {
    width: 20%;
}

.sct-clicks-badge {
    display: inline-block;
    background-color: #2271b1;
    color: #fff;
    border-radius: 20px;
    padding: 5px 10px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.sct-action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.sct-action-buttons .button {
    display: flex;
    align-items: center;
    gap: 3px;
}

.sct-action-buttons .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Stats Modal */
.sct-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.sct-modal-content {
    background-color: #fff;
    margin: 5% auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 900px;
    position: relative;
    overflow: hidden;
}

.sct-modal-header {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sct-modal-header h2 {
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 18px;
}

.sct-close {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.sct-close:hover,
.sct-close:focus {
    opacity: 0.8;
    text-decoration: none;
}

.sct-loading {
    text-align: center;
    padding: 40px 20px;
}

.sct-loading .spinner {
    float: none;
    margin: 0 auto 10px;
}

/* Stats Overview */
.sct-stats-overview {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
}

.sct-stat-box {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.sct-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2271b1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sct-stat-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #fff;
}

.sct-stat-details {
    flex-grow: 1;
}

.sct-stat-details h3 {
    margin: 0 0 5px;
    font-size: 14px;
    color: #50575e;
}

.sct-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
}

.sct-chart-container {
    padding: 20px;
    border-top: 1px solid #f0f0f1;
}

.sct-chart-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
}

.sct-top-pages {
    padding: 20px;
    border-top: 1px solid #f0f0f1;
}

.sct-top-pages h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
}

.sct-modal-footer {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #f0f0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Form Styles */
.sct-form-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 20px;
}

.sct-form-field {
    margin-bottom: 20px;
}

.sct-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.sct-form-field input[type="text"],
.sct-form-field textarea {
    width: 100%;
    max-width: 500px;
    border-radius: 4px;
}

.sct-form-field .required {
    color: #dc3232;
}

.sct-form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.sct-form-response {
    margin-top: 20px;
    padding: 10px 15px;
    border-left: 4px solid #46b450;
    background: #fff;
    border-radius: 4px;
}

.sct-form-response.error {
    border-left-color: #dc3232;
}

/* Settings Page Styles */
.sct-settings-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    overflow: hidden;
}

.sct-settings-header {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
}

.sct-settings-icon {
    margin-right: 15px;
}

.sct-settings-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
}

.sct-settings-title h2 {
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 20px;
    line-height: 1.4;
}

.sct-settings-title p {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.sct-settings-form {
    padding: 0;
}

.sct-settings-section {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.sct-settings-section h3 {
    margin-top: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    color: #1d2327;
}

.sct-settings-section h3 .dashicons {
    margin-right: 8px;
    color: #2271b1;
}

.sct-settings-fields {
    margin-top: 15px;
    padding-left: 10px;
}

.sct-toggle-field {
    margin-bottom: 15px;
    position: relative;
}

.sct-toggle-field label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.sct-toggle-field input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sct-toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: .4s;
    margin-right: 10px;
}

.sct-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.sct-toggle-field input:checked + .sct-toggle-slider {
    background-color: #2271b1;
}

.sct-toggle-field input:checked + .sct-toggle-slider:before {
    transform: translateX(20px);
}

.sct-toggle-label {
    font-weight: 600;
}

.sct-number-field {
    margin-bottom: 15px;
}

.sct-number-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.sct-number-field input[type="number"] {
    width: 100px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #8c8f94;
}

.sct-about-content {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 15px;
}

.sct-settings-actions {
    padding: 20px 25px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Analytics Page Styles */
.sct-analytics-container {
    margin-top: 20px;
}

.sct-analytics-header {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.sct-analytics-header form {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 15px;
    min-width: 650px;
}

.sct-analytics-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.sct-filter-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.sct-filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.sct-filter-group select,
.sct-filter-group input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #8c8f94;
}

.sct-filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-top: 0;
    white-space: nowrap;
}

.sct-filter-actions .button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 15px;
    height: auto;
    min-height: 36px;
}

.sct-filter-actions .button .dashicons {
    margin-right: 5px;
    font-size: 16px;
    height: 16px;
    width: 16px;
    line-height: 1;
}

.sct-analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.sct-analytics-chart {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: relative;
    min-height: 400px;
}

.sct-analytics-chart canvas {
    max-height: 350px;
    width: 100% !important;
}

.sct-analytics-chart h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.sct-analytics-chart h3 .dashicons {
    margin-right: 8px;
    color: #2271b1;
}

.sct-analytics-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.sct-analytics-widget {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: relative;
    min-height: 300px;
}

.sct-analytics-widget h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.sct-analytics-widget h3 .dashicons {
    margin-right: 8px;
    color: #2271b1;
}

.sct-analytics-widget canvas {
    max-height: 220px;
    width: 100% !important;
}

.sct-stat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sct-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.sct-stat-item:last-child {
    border-bottom: none;
}

.sct-stat-label {
    font-weight: 600;
}

.sct-stat-value {
    color: #2271b1;
    font-weight: 600;
}

.sct-analytics-table {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 0;
}

.sct-analytics-table h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.sct-analytics-table h3 .dashicons {
    margin-right: 8px;
    color: #2271b1;
}

/* Responsive Styles */
@media screen and (max-width: 782px) {
    .sct-header {
        flex-direction: column;
        text-align: center;
    }
    
    .sct-header-actions {
        margin-top: 15px;
    }
    
    .sct-overview-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Make date range card full width on tablets */
    .sct-overview-cards .sct-card:nth-child(3) {
        grid-column: 1 / -1;
    }
    
    .sct-analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .sct-analytics-chart {
        min-height: 350px;
    }
    
    .sct-analytics-chart canvas {
        max-height: 300px;
    }
    
    .sct-analytics-widget {
        min-height: 250px;
    }
    
    .sct-analytics-widget canvas {
        max-height: 200px;
    }
    
    .sct-settings-header {
        flex-direction: column;
        text-align: center;
    }
    
    .sct-settings-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .sct-stats-overview {
        flex-direction: column;
    }
    
    .sct-settings-actions {
        flex-direction: column;
    }
    
    .sct-settings-actions .button {
        margin-bottom: 10px;
        width: 100%;
        text-align: center;
    }
    
    /* Comment out these styles to keep the form in a single row */
    /*
    .sct-analytics-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .sct-filter-group {
        width: 100%;
    }
    
    .sct-filter-actions {
        width: 100%;
        margin-top: 15px;
    }
    */
}

@media screen and (max-width: 600px) {
    .sct-overview-cards {
        grid-template-columns: 1fr;
    }
    
    .sct-action-buttons {
        flex-direction: column;
    }
    
    .sct-action-buttons .button {
        width: 100%;
        margin-bottom: 5px;
        justify-content: center;
    }
}

/* Premium Features Styles - Removed for WordPress.org repository compliance */ 