/**
 * ContentPulse Admin Styles
 *
 * @package ContentPulse
 * @since 1.0.0
 */

/* Dashboard Widget Styles */
.contentpulse-widget {
    font-size: 13px;
}

.contentpulse-widget ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.contentpulse-widget li {
    margin-bottom: 15px;
    padding: 8px;
    background: #f9f9f9;
    border-left: 3px solid #dc3232;
    border-radius: 0 3px 3px 0;
}

.contentpulse-widget li:last-child {
    margin-bottom: 0;
}

.contentpulse-widget a {
    color: #0073aa;
    text-decoration: none;
}

.contentpulse-widget a:hover {
    color: #005177;
    text-decoration: underline;
}

.contentpulse-widget small {
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.contentpulse-widget .status-needs-review {
    color: #dc3232;
    font-weight: 500;
}

/* Meta Box Styles */
.contentpulse-meta-box {
    padding: 0;
}

.contentpulse-meta-box p {
    margin: 0 0 15px 0;
}

.contentpulse-meta-box p:last-child {
    margin-bottom: 0;
}

.contentpulse-meta-box input[type="text"] {
    width: 100%;
    margin-top: 5px;
}

.contentpulse-meta-box input[type="checkbox"] {
    margin-right: 8px;
}

.contentpulse-meta-box .description {
    font-style: italic;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

/* Date input field specific styles */
#contentpulse_next_review_date {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 13px;
    line-height: 1.4;
    padding: 6px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background-color: #fff;
    color: #2c3338;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#contentpulse_next_review_date:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: 2px solid transparent;
    outline-offset: 2px;
}

#contentpulse_next_review_date:hover {
    border-color: #007cba;
}

#contentpulse_next_review_date::placeholder {
    color: #757575;
    opacity: 1;
}

/* Ensure proper spacing in meta box */
.contentpulse-meta-box > div:last-child {
    margin-bottom: 0;
}

/* Datepicker Styles - Ensure proper display */
.ui-datepicker {
    z-index: 999999 !important;
    font-size: 13px;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
}

.ui-datepicker .ui-datepicker-header {
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.ui-datepicker .ui-datepicker-title {
    font-weight: 600;
    color: #333;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    cursor: pointer;
    position: absolute;
    top: 8px;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    color: #666;
}

.ui-datepicker .ui-datepicker-prev {
    left: 8px;
}

.ui-datepicker .ui-datepicker-next {
    right: 8px;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    color: #0073aa;
}

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

.ui-datepicker th {
    padding: 5px;
    text-align: center;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #eee;
}

.ui-datepicker td {
    padding: 2px;
    text-align: center;
}

.ui-datepicker td a {
    display: block;
    padding: 5px;
    text-decoration: none;
    color: #333;
    border-radius: 3px;
}

.ui-datepicker td a:hover {
    background: #f0f0f0;
}

.ui-datepicker td a.ui-state-active {
    background: #0073aa;
    color: #fff;
}

.ui-datepicker td a.ui-state-highlight {
    background: #fff3cd;
    color: #856404;
}

/* Ensure datepicker doesn't interfere with other elements */
.ui-datepicker.ui-datepicker-multi {
    z-index: 999999 !important;
}

.ui-datepicker.ui-datepicker-multi .ui-datepicker-group {
    float: left;
}

/* Responsive datepicker */
@media screen and (max-width: 782px) {
    .ui-datepicker {
        font-size: 14px;
        width: 280px;
    }
    
    .ui-datepicker td a {
        padding: 8px;
    }
}

/* Settings Page Styles */
.contentpulse-settings {
    max-width: 800px;
}

.contentpulse-settings .card {
    margin-top: 20px;
}

.contentpulse-settings .card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.contentpulse-settings .statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.contentpulse-settings .stat-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

.contentpulse-settings .stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    display: block;
}

.contentpulse-settings .stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Field Styles */
.contentpulse-settings input[type="number"],
.contentpulse-settings input[type="email"] {
    width: 100px;
}

.contentpulse-settings input[type="email"] {
    width: 300px;
}

.contentpulse-settings .form-table th {
    width: 200px;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .contentpulse-widget {
        font-size: 14px;
    }
    
    .contentpulse-widget li {
        padding: 10px;
    }
    
    .contentpulse-settings .statistics-grid {
        grid-template-columns: 1fr;
    }
    
    .contentpulse-settings input[type="email"] {
        width: 100%;
    }
}

/* Dashboard Widget Icon */
#contentpulse_widget .dashicons {
    color: #dc3232;
    margin-right: 5px;
}

/* Notice Styles */
.contentpulse-notice {
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid #0073aa;
    background: #f0f8ff;
}

.contentpulse-notice.error {
    border-left-color: #dc3232;
    background: #fff0f0;
}

.contentpulse-notice.success {
    border-left-color: #46b450;
    background: #f0fff0;
}

/* Loading States */
.contentpulse-loading {
    opacity: 0.6;
    pointer-events: none;
}

.contentpulse-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #0073aa;
    border-top-color: transparent;
    border-radius: 50%;
    animation: contentpulse-spin 1s linear infinite;
}

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

/* Accessibility Improvements */
.contentpulse-widget a:focus,
.contentpulse-meta-box input:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .contentpulse-widget,
    .contentpulse-meta-box {
        background: white !important;
        color: black !important;
    }
}