/**
 * Upload Modal Styles v2.0.5
 * 
 * Fixes:
 * - Button alignment and centering
 * - White text on gradient backgrounds
 * - Click area boundary
 * - Removed conflicting !important declarations
 * 
 * Version: 2.0.5
 */

/* ==========================================
   UPLOAD MODAL - GENERAL
   ========================================== */

.ctod-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctod-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.ctod-upload-modal-content {
    position: relative;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

/* Step Container */
.ctod-upload-step {
    display: none;
}

.ctod-upload-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step Header */
.ctod-step-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.ctod-step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.ctod-step-title h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: #333;
}

.ctod-step-title p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* ==========================================
   STEP 1: FOLDER SELECTION
   ========================================== */

.ctod-folder-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.ctod-folder-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.ctod-folder-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(5px);
}

.ctod-folder-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.ctod-folder-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ctod-folder-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: white !important;
}

.ctod-folder-content {
    flex: 1;
}

.ctod-folder-content h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.ctod-folder-content p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.ctod-folder-check {
    width: 30px;
    height: 30px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: all 0.2s;
}

.ctod-folder-option.selected .ctod-folder-check {
    opacity: 1;
    background: #667eea;
    border-color: #667eea;
}

.ctod-folder-check .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: white !important;
}

/* Event Selection */
.ctod-event-selection {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.ctod-event-selection label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.ctod-required {
    color: #dc3232;
    margin-left: 3px;
}

.ctod-event-selection .ctod-select,
.ctod-event-selection select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.ctod-field-help {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Step Actions */
.ctod-step-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* ==========================================
   STEP 2: FILE UPLOAD
   ========================================== */

.ctod-destination-summary {
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    margin-bottom: 20px;
}

.ctod-destination-summary strong {
    color: #667eea;
}

/* Drag & Drop Area */
.ctod-upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s;
    cursor: pointer;
    margin-bottom: 25px;
    position: relative; /* v2.0.5 - Fixed click area boundary */
}

.ctod-upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.ctod-upload-area.drag-over {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-style: solid;
}

.ctod-upload-area .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: #667eea;
    margin-bottom: 15px;
}

.ctod-upload-area h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.ctod-upload-area > p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.ctod-upload-hint {
    font-size: 12px;
    color: #999;
    margin-bottom: 20px !important;
}

/* Upload Queue */
.ctod-upload-queue {
    margin-bottom: 20px;
}

.ctod-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.ctod-queue-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.ctod-queue-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
}

/* Queue Item */
.ctod-queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s;
}

.ctod-queue-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ctod-queue-item-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ctod-queue-item-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: white !important;
}

.ctod-queue-item-info {
    flex: 1;
    min-width: 0;
}

.ctod-queue-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctod-queue-item-size {
    font-size: 12px;
    color: #999;
}

.ctod-queue-item-status {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.ctod-queue-item-status.pending {
    color: #666;
    background: #f0f0f0;
}

.ctod-queue-item-status.uploading {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.ctod-queue-item-status.complete {
    color: #46b450;
    background: rgba(70, 180, 80, 0.1);
}

.ctod-queue-item-status.error {
    color: #dc3232;
    background: rgba(220, 50, 50, 0.1);
}

.ctod-queue-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 5px;
    transition: color 0.2s;
}

.ctod-queue-item-remove:hover {
    color: #dc3232;
}

.ctod-queue-item-remove .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ==========================================
   UPLOAD PROGRESS
   ========================================== */

.ctod-upload-progress {
    text-align: center;
    padding: 40px 20px;
}

.ctod-progress-header h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.ctod-progress-status {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #666;
}

.ctod-progress-bar-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.ctod-progress-bar {
    width: 100%;
    height: 40px;
    background: #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.ctod-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    color: white !important;
    font-weight: 600;
}

.ctod-progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 600;
    color: #333;
    z-index: 1;
}

.ctod-progress-files {
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

/* ==========================================
   UPLOAD RESULTS
   ========================================== */

.ctod-upload-results {
    text-align: center;
    padding: 40px 20px;
}

.ctod-results-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #46b450 0%, #38a54a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.ctod-results-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: white !important;
}

.ctod-upload-results h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.ctod-upload-results p {
    margin: 0 0 30px 0;
    font-size: 14px;
    color: #666;
}

.ctod-results-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */

.ctod-form-group {
    margin-bottom: 20px;
}

.ctod-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.ctod-optional {
    font-weight: 400;
    color: #999;
    font-style: italic;
}

.ctod-textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.ctod-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ==========================================
   BUTTONS - v2.0.5 Fixed centering and colors
   ========================================== */
/* ==========================================
   BUTTONS - v2.0.6 Increased specificity to override theme
   ========================================== */

/* Base button styles with higher specificity */
.ctod-modal .ctod-btn,
.ctod-upload-modal-content .ctod-btn,
button.ctod-btn,
a.ctod-btn {
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.ctod-modal .ctod-btn .dashicons,
.ctod-upload-modal-content .ctod-btn .dashicons,
button.ctod-btn .dashicons,
a.ctod-btn .dashicons {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Primary button - gradient background with white text */
.ctod-modal .ctod-btn-primary,
.ctod-upload-modal-content .ctod-btn-primary,
button.ctod-btn.ctod-btn-primary,
a.ctod-btn.ctod-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
}

.ctod-modal .ctod-btn-primary:hover,
.ctod-upload-modal-content .ctod-btn-primary:hover,
button.ctod-btn.ctod-btn-primary:hover,
a.ctod-btn.ctod-btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
    color: white !important;
}

.ctod-modal .ctod-btn-primary:disabled,
.ctod-upload-modal-content .ctod-btn-primary:disabled,
button.ctod-btn.ctod-btn-primary:disabled,
a.ctod-btn.ctod-btn-primary:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Secondary button - light background with dark text */
.ctod-modal .ctod-btn-secondary,
.ctod-upload-modal-content .ctod-btn-secondary,
button.ctod-btn.ctod-btn-secondary,
a.ctod-btn.ctod-btn-secondary {
    background: #f8f9fa !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
}

.ctod-modal .ctod-btn-secondary:hover,
.ctod-upload-modal-content .ctod-btn-secondary:hover,
button.ctod-btn.ctod-btn-secondary:hover,
a.ctod-btn.ctod-btn-secondary:hover {
    background: #fff !important;
    border-color: #999 !important;
}

/* Link button */
.ctod-modal .ctod-btn-link,
.ctod-upload-modal-content .ctod-btn-link,
button.ctod-btn.ctod-btn-link,
a.ctod-btn.ctod-btn-link {
    background: none !important;
    border: none !important;
    color: #667eea !important;
    cursor: pointer !important;
    font-size: 13px !important;
    text-decoration: underline !important;
    padding: 0 !important;
}

.ctod-modal .ctod-btn-link:hover,
.ctod-upload-modal-content .ctod-btn-link:hover,
button.ctod-btn.ctod-btn-link:hover,
a.ctod-btn.ctod-btn-link:hover {
    color: #764ba2 !important;
}

/* Ensure dashicons in buttons are white on gradient backgrounds */
.ctod-modal .ctod-btn-primary .dashicons,
.ctod-upload-modal-content .ctod-btn-primary .dashicons,
button.ctod-btn.ctod-btn-primary .dashicons,
a.ctod-btn.ctod-btn-primary .dashicons {
    color: white !important;
}

/* ==========================================
   MODAL FOOTER
   ========================================== */

.ctod-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .ctod-upload-modal-content {
        max-width: 95%;
        margin: 20px;
        padding: 20px;
    }
    
    .ctod-folder-option {
        flex-direction: column;
        text-align: center;
    }
    
    .ctod-folder-check {
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    .ctod-modal-footer {
        flex-direction: column;
    }
    
    .ctod-results-actions {
        flex-direction: column;
    }
    
    .ctod-upload-area {
        padding: 40px 20px;
		position: relative;
    }
}