/**
 * MA Smart Image Cleaner - Admin Styles
 *
 * @package MA_Smart_Image_Cleaner
 */

/* ==========================================================================
   General Layout
   ========================================================================== */

.masic-wrap {
    margin: 20px 20px 20px 0;
}

.masic-wrap h1 .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.masic-nav-tabs {
    margin: 20px 0;
}

.masic-page-description {
    color: #646970;
    font-size: 13px;
    margin: 0 0 20px;
}

/* ==========================================================================
   Dashboard Stats
   ========================================================================== */

.masic-dashboard {
    max-width: 1200px;
}

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

.masic-stat-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.masic-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.masic-icon-total {
    background: #2271b1;
}

.masic-icon-used {
    background: #00a32a;
}

.masic-icon-unused {
    background: #d63638;
}

.masic-icon-uncertain {
    background: #dba617;
}

.masic-stat-content {
    display: flex;
    flex-direction: column;
}

.masic-stat-number {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    color: #1d2327;
}

.masic-stat-label {
    font-size: 13px;
    color: #646970;
}

.masic-status-used {
    color: #00a32a;
}

.masic-status-unused {
    color: #d63638;
}

.masic-status-uncertain {
    color: #dba617;
}

/* ==========================================================================
   Storage Section
   ========================================================================== */

.masic-storage-section {
    margin-bottom: 24px;
}

.masic-storage-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
}

.masic-storage-card h3 {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
}

.masic-storage-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 12px;
}

.masic-storage-item {
    display: flex;
    flex-direction: column;
}

.masic-storage-label {
    font-size: 12px;
    color: #646970;
    margin-bottom: 4px;
}

.masic-storage-value {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.masic-savings .masic-storage-value {
    color: #00a32a;
}

.masic-last-scan {
    font-size: 13px;
    color: #646970;
}

.masic-last-scan .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: text-bottom;
}

/* ==========================================================================
   Scan Section
   ========================================================================== */

.masic-scan-section {
    margin-bottom: 24px;
}

.masic-scan-card {
    background: #fff;
    border: 2px solid #2271b1;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    background: linear-gradient(180deg, #f0f6fc 0%, #fff 100%);
}

.masic-scan-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #2271b1;
    margin-bottom: 16px;
}

.masic-scan-start h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: #1d2327;
}

.masic-scan-start p {
    color: #646970;
    margin: 0 0 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.masic-btn-hero {
    font-size: 16px !important;
    padding: 12px 32px !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

.masic-btn-hero .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.masic-btn-large {
    padding: 8px 20px !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

.masic-btn-large .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Scan Progress */
.masic-scan-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.masic-scan-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1d2327;
}

.masic-scan-header .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #2271b1;
}

.masic-progress-percent {
    font-size: 20px;
    font-weight: 700;
    color: #2271b1;
}

.masic-progress-bar {
    background: #dcdcde;
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
    margin-bottom: 16px;
}

.masic-progress-fill {
    background: linear-gradient(90deg, #2271b1, #135e96);
    height: 100%;
    transition: width 0.2s ease;
    border-radius: 8px;
}

.masic-progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 12px;
}

.masic-progress-text {
    color: #1d2327;
}

.masic-estimated-time {
    color: #646970;
}

.masic-progress-current {
    font-size: 13px;
    color: #646970;
    margin-bottom: 20px;
    text-align: left;
}

.masic-progress-current code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.masic-scan-actions .button {
    margin: 0 4px;
}

/* Spinning animation */
@keyframes masic-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.masic-spinning {
    animation: masic-spin 1s linear infinite;
}

/* Credits */
.masic-credits {
    text-align: center;
    padding: 16px;
    margin-top: 24px;
    border-top: 1px solid #dcdcde;
    color: #646970;
    font-size: 13px;
}

.masic-credits a {
    color: #2271b1;
    text-decoration: none;
}

.masic-credits a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Quick Actions
   ========================================================================== */

.masic-quick-actions {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 24px;
}

.masic-quick-actions h3 {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
}

.masic-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.masic-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    text-decoration: none;
    color: #1d2327;
    transition: all 0.2s;
}

.masic-action-link:hover {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.masic-action-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Filters
   ========================================================================== */

.masic-filters {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.masic-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.masic-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.masic-filter-group label {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.masic-filter-group select,
.masic-filter-group input {
    min-width: 100px;
}

/* ==========================================================================
   Bulk Actions
   ========================================================================== */

.masic-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.masic-selected-count {
    color: #646970;
    font-size: 13px;
    margin-left: 12px;
}

/* ==========================================================================
   Results Table
   ========================================================================== */

.masic-results-table {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.masic-results-table table {
    margin: 0;
}

.masic-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.masic-thumbnail.masic-trashed {
    opacity: 0.5;
}

.masic-no-thumb {
    font-size: 32px;
    width: 50px;
    height: 50px;
    color: #c3c4c7;
    display: block;
}

.masic-keep-badge {
    color: #d63638;
    margin-left: 6px;
}

.masic-keep-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.masic-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.masic-status-badge.masic-status-used {
    background: #edfaef;
    color: #00a32a;
}

.masic-status-badge.masic-status-unused {
    background: #fcf0f1;
    color: #d63638;
}

.masic-status-badge.masic-status-uncertain {
    background: #fcf9e8;
    color: #996800;
}

.masic-usage-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
}

.masic-usage-list li {
    margin-bottom: 4px;
}

.masic-usage-type {
    color: #646970;
    font-size: 11px;
}

.masic-more {
    color: #646970;
    font-style: italic;
}

.masic-no-usage {
    color: #646970;
    font-style: italic;
}

.column-actions .button {
    margin-right: 4px;
}

.column-actions .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: text-top;
}

/* ==========================================================================
   No Results
   ========================================================================== */

.masic-no-results {
    text-align: center;
    padding: 60px 20px;
}

.masic-no-results .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #c3c4c7;
    margin-bottom: 16px;
}

.masic-no-results p {
    color: #646970;
    font-size: 14px;
    margin-bottom: 20px;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.masic-pagination {
    padding: 16px;
    border-top: 1px solid #c3c4c7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.masic-pagination .page-numbers {
    display: inline-block;
    padding: 4px 10px;
    text-decoration: none;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    color: #2271b1;
}

.masic-pagination .page-numbers.current {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.masic-total-items {
    margin-left: auto;
    color: #646970;
    font-size: 13px;
}

/* ==========================================================================
   Trash
   ========================================================================== */

.masic-trash-notice {
    margin: 20px 0 !important;
}

.masic-trash-notice .dashicons {
    margin-right: 6px;
}

.masic-expires-soon {
    color: #d63638;
    font-weight: 500;
}

.masic-file-id {
    font-size: 11px;
    color: #646970;
}

/* ==========================================================================
   Logs
   ========================================================================== */

.masic-days-remaining {
    font-size: 11px;
    color: #646970;
    margin-top: 4px;
}

.masic-restored-date {
    color: #646970;
    font-size: 12px;
}

/* ==========================================================================
   Settings
   ========================================================================== */

.masic-settings-form {
    max-width: 800px;
}

.masic-settings-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.masic-settings-section h2 {
    margin: 0 0 16px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    border: none;
}

.masic-settings-section .form-table {
    margin: 0;
}

.masic-settings-section .form-table th {
    width: 200px;
    padding-left: 0;
}

.masic-notice-muted {
    color: #646970;
    font-style: italic;
}

.masic-danger-zone {
    border-color: #d63638;
}

.masic-danger-zone h2 {
    color: #d63638;
}

.masic-clear-data {
    border-color: #d63638;
    color: #d63638;
}

.masic-clear-data:hover {
    background: #d63638;
    border-color: #d63638;
    color: #fff;
}

/* ==========================================================================
   Dashboard Widget
   ========================================================================== */

.masic-dashboard-widget .masic-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f1;
}

.masic-dashboard-widget .masic-stat-row:last-of-type {
    border-bottom: none;
}

.masic-dashboard-widget .masic-stat-label {
    color: #646970;
}

.masic-dashboard-widget .masic-stat-value {
    font-weight: 500;
}

.masic-dashboard-widget .masic-status-used {
    color: #00a32a;
}

.masic-dashboard-widget .masic-status-unused {
    color: #d63638;
}

.masic-widget-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f1;
}

.masic-widget-actions .button {
    margin-right: 8px;
}

/* ==========================================================================
   Info Notice
   ========================================================================== */

.masic-info-notice {
    margin-top: 20px !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 782px) {
    .masic-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .masic-storage-stats {
        flex-direction: column;
        gap: 16px;
    }

    .masic-filter-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .masic-settings-section .form-table th {
        width: auto;
        padding-bottom: 0;
    }

    .column-usage,
    .column-date {
        display: none;
    }
}

@media screen and (max-width: 600px) {
    .masic-stats-grid {
        grid-template-columns: 1fr;
    }

    .masic-actions-grid {
        flex-direction: column;
    }

    .masic-action-link {
        width: 100%;
        justify-content: center;
    }
}
