/**
 * StaticQ - Admin Styles
 * 
 * @package suspended-cloud/staticq
 * @since 2.0.0
 */

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

.sqmedia-admin-wrap {
    max-width: 1200px;
}

.sqmedia-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* =========================================================================
   Sections (Media Manager)
   ========================================================================= */

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

.sqmedia-section h2 {
    margin: -20px -20px 20px -20px;
    padding: 15px 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.sqmedia-section h3 {
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}

.sqmedia-section-description {
    color: #646970;
    margin-bottom: 15px;
}

/* =========================================================================
   Stats Grid (Overview)
   ========================================================================= */

.sqmedia-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.sqmedia-stat-card {
    background: #f6f7f7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 1px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.sqmedia-stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.sqmedia-stat-label {
    display: block;
    font-size: 12px;
    color: #646970;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sqmedia-stat-success {
    background: #e7f5e7;
    border-color: #00a32a;
}

.sqmedia-stat-success .sqmedia-stat-number {
    color: #00a32a;
}

.sqmedia-stat-warning {
    background: #fcf9e8;
    border-color: #dba617;
}

.sqmedia-stat-warning .sqmedia-stat-number {
    color: #996800;
}

.sqmedia-stat-error {
    background: #fcf0f1;
    border-color: #d63638;
}

.sqmedia-stat-error .sqmedia-stat-number {
    color: #d63638;
}

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

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

.sqmedia-setting-item {
    background: #f6f7f7;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 13px;
}

.sqmedia-setting-item strong {
    display: block;
    margin-bottom: 4px;
    color: #1d2327;
}

.sqmedia-sizes-list {
    margin-top: 15px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
}

.sqmedia-sizes-list h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
}

.sqmedia-sizes-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sqmedia-size-badge {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-family: monospace;
}

/* =========================================================================
   Cards (Legacy support)
   ========================================================================= */

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

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

.sqmedia-card h3 {
    margin-top: 20px;
}

.sqmedia-card h4 {
    margin-top: 15px;
    margin-bottom: 10px;
}

.sqmedia-card-success {
    border-color: #46b450;
    background: #f0fff0;
}

/* =========================================================================
   Stats (Legacy)
   ========================================================================= */

.sqmedia-stat-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.sqmedia-stat {
    text-align: center;
    padding: 15px 20px;
    background: #f6f7f7;
    border-radius: 4px;
    min-width: 100px;
}

.sqmedia-stat-small .sqmedia-stat {
    padding: 10px 15px;
    min-width: 80px;
}

.sqmedia-stat-ok {
    background: #e7f5e7;
}

.sqmedia-stat-ok .sqmedia-stat-number {
    color: #00a32a;
}

/* =========================================================================
   Progress Bar
   ========================================================================= */

.sqmedia-progress-bar {
    height: 20px;
    background: #dcdcde;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

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

.sqmedia-progress-animated .sqmedia-progress-fill {
    background: linear-gradient(90deg, #2271b1, #135e96, #2271b1);
    background-size: 200% 100%;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.sqmedia-progress-text {
    font-size: 14px;
    color: #646970;
    margin: 5px 0;
}

.sqmedia-progress-section {
    margin: 20px 0;
    display: none;
}

.sqmedia-progress-section.active {
    display: block;
}

/* =========================================================================
   Status Indicators
   ========================================================================= */

.sqmedia-status-ok {
    color: #00a32a;
}

.sqmedia-status-warning {
    color: #dba617;
}

.sqmedia-status-error {
    color: #d63638;
}

.sqmedia-status-box {
    padding: 12px 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.sqmedia-status-box.success {
    background: #e7f5e7;
    border-left: 4px solid #00a32a;
}

.sqmedia-status-box.warning {
    background: #fcf9e8;
    border-left: 4px solid #dba617;
}

.sqmedia-status-box.error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
}

.sqmedia-status-table {
    width: 100%;
    border-collapse: collapse;
}

.sqmedia-status-table td {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.sqmedia-status-table td:last-child {
    text-align: right;
}

/* =========================================================================
   Registration Section
   ========================================================================= */

.sqmedia-registration-status {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.sqmedia-registration-status.sqmedia-status-warning {
    background: #fcf9e8;
    border-left: 4px solid #dba617;
}

.sqmedia-registration-status.sqmedia-status-success {
    background: #e7f5e7;
    border-left: 4px solid #00a32a;
}

.sqmedia-registration-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.sqmedia-registration-actions button {
    min-width: 150px;
}

.sqmedia-registration-advanced {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.sqmedia-date-filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.sqmedia-date-filters label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sqmedia-date-filters input[type="date"] {
    padding: 4px 8px;
}

/* =========================================================================
   Batch History
   ========================================================================= */

.sqmedia-batch-history {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.sqmedia-batch-history table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.sqmedia-batch-history th,
.sqmedia-batch-history td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.sqmedia-batch-history th {
    background: #f6f7f7;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.sqmedia-batch-history tr:last-child td {
    border-bottom: none;
}

/* =========================================================================
   Health Check Section
   ========================================================================= */

.sqmedia-health-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #f6f7f7;
    border-radius: 4px;
}

.sqmedia-health-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.sqmedia-issues-summary {
    margin-top: 20px;
}

.sqmedia-issues-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.sqmedia-issues-table th,
.sqmedia-issues-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.sqmedia-issues-table th {
    background: #f6f7f7;
    font-weight: 600;
}

.sqmedia-issues-table tr:hover {
    background: #f9f9f9;
}

.sqmedia-issues-table .count {
    font-weight: 600;
    min-width: 60px;
}

.sqmedia-issues-table .actions {
    text-align: right;
}

/* =========================================================================
   Attachment Lookup
   ========================================================================= */

.sqmedia-lookup-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.sqmedia-lookup-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sqmedia-lookup-form input[type="number"] {
    width: 120px;
    padding: 6px 10px;
}

.sqmedia-lookup-result {
    margin-top: 20px;
}

.sqmedia-lookup-result-card {
    background: #f6f7f7;
    border-radius: 4px;
    padding: 20px;
}

.sqmedia-lookup-result-card h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.sqmedia-lookup-result-card h4 small {
    font-weight: normal;
    color: #646970;
}

.sqmedia-lookup-status {
    padding: 10px 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.sqmedia-lookup-status.success {
    background: #e7f5e7;
}

.sqmedia-lookup-status.warning {
    background: #fcf9e8;
}

.sqmedia-lookup-status.error {
    background: #fcf0f1;
}

.sqmedia-actions-list {
    margin: 15px 0;
    padding-left: 20px;
}

.sqmedia-actions-list li {
    margin-bottom: 10px;
}

.sqmedia-action-description {
    font-size: 12px;
    color: #646970;
    margin-top: 3px;
}

/* =========================================================================
   Info/Warning Boxes
   ========================================================================= */

.sqmedia-info-box {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
    margin: 15px 0;
}

.sqmedia-info-box p {
    margin: 0;
}

.sqmedia-settings-note {
    background: #fcf9e8;
    border-left: 4px solid #dba617;
    padding: 12px 15px;
    margin: 15px 0;
}

.sqmedia-settings-note p {
    margin: 0;
}

/* =========================================================================
   Quick Links
   ========================================================================= */

.sqmedia-link-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.sqmedia-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 30px;
    background: #f6f7f7;
    border-radius: 4px;
    text-decoration: none;
    color: #1d2327;
    transition: background 0.2s, transform 0.2s;
}

.sqmedia-link-card:hover {
    background: #e7e8ea;
    transform: translateY(-2px);
    color: #1d2327;
}

.sqmedia-link-card .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    color: #2271b1;
}

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

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

.sqmedia-settings-section h2 {
    margin: 0 -20px 20px;
    padding: 15px 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
    font-size: 14px;
}

.sqmedia-test-result {
    margin-left: 10px;
}

/* =========================================================================
   Migration/Registration
   ========================================================================= */

.sqmedia-migration-active {
    border-color: #2271b1;
    border-width: 2px;
}

.sqmedia-migration-results {
    background: #f6f7f7;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.sqmedia-migration-results ul {
    margin: 0;
    list-style: none;
}

.sqmedia-migration-results li {
    padding: 3px 0;
}

.sqmedia-recent-items ul {
    margin: 0;
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

.sqmedia-recent-items li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.sqmedia-migration-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.sqmedia-migration-actions button {
    margin-right: 10px;
}

/* =========================================================================
   Buttons
   ========================================================================= */

.sqmedia-button-danger {
    color: #d63638 !important;
    border-color: #d63638 !important;
}

.sqmedia-button-danger:hover {
    background: #d63638 !important;
    color: #fff !important;
}

/* =========================================================================
   Attachment Detail
   ========================================================================= */

.sqmedia-attachment-detail-box {
    background: #f6f7f7;
    padding: 20px;
    border-radius: 4px;
    margin-top: 15px;
}

.sqmedia-attachment-detail-box h3 {
    margin-top: 0;
}

.sqmedia-attachment-detail-box table {
    margin: 15px 0;
}

.sqmedia-scan-date {
    font-size: 13px;
    color: #646970;
}

/* =========================================================================
   Loading Spinner
   ========================================================================= */

.sqmedia-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

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

@media screen and (max-width: 782px) {
    .sqmedia-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sqmedia-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .sqmedia-stat-grid {
        flex-direction: column;
    }
    
    .sqmedia-stat {
        min-width: auto;
    }
    
    .sqmedia-link-grid {
        flex-direction: column;
    }
    
    .sqmedia-link-card {
        flex-direction: row;
        padding: 15px 20px;
    }
    
    .sqmedia-link-card .dashicons {
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .sqmedia-lookup-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sqmedia-registration-actions {
        flex-direction: column;
    }
    
    .sqmedia-registration-actions button {
        width: 100%;
    }
}