/**
 * Viraly Post Editor Styles
 * For both Gutenberg and Classic Editor
 */

/* Editor Panel */
.viraly-editor-panel {
    padding: 16px;
    background: #ffffff;
}

.viraly-editor-header {
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e7;
}

.viraly-editor-logo {
    height: 16px;
    width: auto;
}

/* Status Display */
.viraly-editor-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 16px;
}

.viraly-status-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.viraly-status-published {
    color: #25e2b8;
}

.viraly-status-draft {
    color: #f59e0b;
}

.viraly-status-scheduled {
    color: #3b82f6;
}

.viraly-status-pending {
    color: #8b5cf6;
}

.viraly-status-text {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

/* Action Button */
.viraly-editor-action {
    margin-bottom: 12px;
}

.viraly-editor-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #E03058 !important;
    border-color: #E03058 !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 10px 16px !important;
    height: auto !important;
    border-radius: 6px !important;
    transition: background 0.2s ease !important;
    text-decoration: none !important;
}

.viraly-editor-btn:hover {
    background: #B11B3E !important;
    border-color: #B11B3E !important;
}

.viraly-editor-btn .dashicons,
.viraly-editor-btn i {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Description */
.viraly-editor-description {
    font-size: 13px;
    line-height: 1.5;
    color: #6e6e73;
    margin-bottom: 12px;
    text-align: center;
}

/* Notice */
.viraly-editor-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: #856404;
}

.viraly-editor-notice .dashicons,
.viraly-editor-notice i {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #ffc107;
}

/* Gutenberg Sidebar Specific Styles */
.viraly-gutenberg-panel {
    padding: 0;
    margin: -16px;
}

.viraly-gutenberg-panel .viraly-editor-panel {
    padding: 16px;
}

/* Classic Editor Metabox */
#viraly_schedule_metabox .inside {
    margin: 0 !important;
    padding: 0 !important;
}

#viraly_schedule_metabox .viraly-editor-panel {
    border: none;
}

/* Platform Selection Modal */
.viraly-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
}

.viraly-modal-overlay.active {
    display: flex;
}

.viraly-modal {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.viraly-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
}

.viraly-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6e6e73;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.viraly-modal-close:hover {
    background: #f5f5f7;
    color: #1d1d1f;
}

.viraly-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.viraly-modal-body p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #6e6e73;
    line-height: 1.5;
}

.viraly-platforms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.viraly-platform-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f9f9f9;
    border: 2px solid #e5e5e7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.viraly-platform-checkbox:hover {
    background: #f5f5f7;
    border-color: #d1d1d6;
}

.viraly-platform-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.viraly-platform-checkbox.checked {
    background: #fff;
    border-color: #E03058;
}

.viraly-platform-checkbox label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
    flex: 1;
}

.viraly-select-all {
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.viraly-select-all label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6e6e73;
    cursor: pointer;
    margin: 0;
}

.viraly-select-all input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.viraly-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e5e7;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.viraly-modal-footer .button {
    padding: 10px 20px !important;
    height: auto !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.viraly-modal-footer .button-primary {
    background: #E03058 !important;
    border-color: #E03058 !important;
}

.viraly-modal-footer .button-primary:hover {
    background: #B11B3E !important;
    border-color: #B11B3E !important;
}

.viraly-modal-footer .button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: auto !important; /* Ensure tooltip works */
}

.viraly-modal-footer .button-primary:disabled:hover {
    background: #E03058 !important; /* Don't change color on hover when disabled */
    border-color: #E03058 !important;
}

/* Loading Overlay */
.viraly-modal-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.viraly-modal-loading.active {
    display: flex;
}

.viraly-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #E03058;
    border-radius: 50%;
    animation: viraly-spin 1s linear infinite;
}

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

.viraly-loading-message {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    text-align: center;
}

/* Position modal relative for loading overlay */
.viraly-modal {
    position: relative;
}
