/**
 * RC YouTube Portfolio Admin Styles
 */

.rcyp-wrap {
    max-width: 1200px;
}

.rcyp-wrap h1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rcyp-wrap h1 .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #c4302b;
}

.rcyp-content {
    margin-top: 20px;
}

/* Cards */
.rcyp-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

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

/* Stats Grid */
.rcyp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.rcyp-stat-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.rcyp-stat-icon {
    margin-bottom: 10px;
}

.rcyp-stat-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #c4302b;
}

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

.rcyp-stat-label {
    font-size: 13px;
    color: #646970;
    margin-top: 5px;
}

/* Sync Button */
#rcyp-sync-now {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#rcyp-sync-now .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

#rcyp-sync-now.syncing .dashicons {
    animation: rcyp-spin 1s linear infinite;
}

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

/* Sync Status */
.rcyp-sync-status {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 4px;
    display: none;
}

.rcyp-sync-status.success {
    display: block;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.rcyp-sync-status.error {
    display: block;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.rcyp-sync-status.loading {
    display: block;
    background: #cce5ff;
    border: 1px solid #b8daff;
    color: #004085;
}

/* Sync Log */
.rcyp-sync-log {
    margin-top: 15px;
    font-family: monospace;
    font-size: 13px;
    max-height: 300px;
    overflow-y: auto;
}

.rcyp-sync-log .log-item {
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
}

.rcyp-sync-log .log-item:last-child {
    border-bottom: none;
}

.rcyp-sync-log .log-item.success {
    color: #155724;
}

.rcyp-sync-log .log-item.error {
    color: #721c24;
}

.rcyp-sync-log .log-item.info {
    color: #004085;
}

/* Progress Bar */
.rcyp-progress-wrap {
    width: 100%;
}

.rcyp-progress-text {
    margin-bottom: 8px;
    font-size: 13px;
    color: #004085;
}

.rcyp-progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.rcyp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 0;
}

/* Test Connection */
#rcyp-test-result {
    margin-left: 10px;
}

#rcyp-test-result.success {
    color: #155724;
}

#rcyp-test-result.error {
    color: #721c24;
}

#rcyp-test-result.loading {
    color: #004085;
}

/* Form Table Improvements */
.rcyp-card .form-table th {
    width: 200px;
}

.rcyp-card .form-table td .description {
    margin-top: 5px;
    color: #646970;
}

/* Imported Videos Table */
.rcyp-card .wp-list-table img {
    border-radius: 4px;
}

.rcyp-card .wp-list-table td {
    vertical-align: middle;
}

/* Help Tab */
.rcyp-card ol,
.rcyp-card ul {
    margin-left: 20px;
}

.rcyp-card ol li,
.rcyp-card ul li {
    margin-bottom: 8px;
}

.rcyp-card a {
    color: #c4302b;
}

.rcyp-card a:hover {
    color: #8b0000;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .rcyp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rcyp-card .form-table th {
        width: auto;
    }
}

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

/* Transcript Paste Modal */
.rcyp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
}

.rcyp-modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 640px;
    z-index: 100000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.rcyp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #ddd;
}

.rcyp-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

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

.rcyp-modal-close:hover {
    color: #d9534f;
}

.rcyp-modal-body {
    padding: 20px;
}

.rcyp-modal-body p {
    margin-top: 0;
}

.rcyp-modal-video-title {
    font-weight: 600;
    color: #1d2327;
}

#rcyp-transcript-input {
    width: 100%;
    font-family: monospace;
    font-size: 13px;
    padding: 10px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    resize: vertical;
}

.rcyp-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #ddd;
}

/* Generate Article Log */
#rcyp-generate-log {
    margin-top: 15px;
    background: #1d2327;
    border-radius: 4px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.6;
}

.rcyp-log-entry {
    padding: 2px 0;
}

.rcyp-log-time {
    color: #888;
    margin-right: 6px;
}

.rcyp-log-info {
    color: #8ec8f0;
}

.rcyp-log-success {
    color: #7dce82;
}

.rcyp-log-success a {
    color: #a8e6a8;
    text-decoration: underline;
}

.rcyp-log-error {
    color: #f28b82;
}

/* Shorts Collection Grid */
.rcyp-shorts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.rcyp-short-item iframe {
    width: 100%;
    aspect-ratio: 9/16;
    border: none;
    border-radius: 8px;
    display: block;
}

.rcyp-short-title {
    font-size: 13px;
    margin: 6px 0 0;
    text-align: center;
    line-height: 1.3;
}

/* Shorts Controls Bar */
.rcyp-shorts-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
}

.rcyp-shorts-search {
    flex: 1;
    min-width: 180px;
}

.rcyp-shorts-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
}

.rcyp-shorts-search-input:focus {
    outline: none;
    border-color: #c4302b;
    box-shadow: 0 0 0 2px rgba(196, 48, 43, 0.15);
}

.rcyp-shorts-sort {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rcyp-sort-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.rcyp-sort-btn:hover {
    background: #eee;
    border-color: #999;
}

.rcyp-sort-btn.active {
    background: #c4302b;
    color: #fff;
    border-color: #c4302b;
}

.rcyp-shorts-count {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

/* Shorts Meta (date & views) */
.rcyp-short-meta {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin: 4px 0 0;
}

@media (max-width: 600px) {
    .rcyp-shorts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .rcyp-shorts-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .rcyp-shorts-search {
        min-width: unset;
    }

    .rcyp-shorts-sort {
        justify-content: center;
    }

    .rcyp-short-meta {
        font-size: 10px;
    }
}
