/* Old Photo Restoration Plugin - Minimalist Design */

/* Design System */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --border: #e5e7eb;
}

/* Upload Form */
.oldphoto-upload-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.oldphoto-balance {
    text-align: center;
    padding: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 30px;
}

.balance-label {
    display: block;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin: 10px 0;
}

.balance-currency {
    color: var(--text-light);
    font-size: 16px;
}

.oldphoto-form .form-group {
    margin-bottom: 24px;
}

.oldphoto-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.oldphoto-form input[type="file"],
.oldphoto-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg);
    transition: border-color 0.2s;
}

.oldphoto-form input[type="file"]:hover,
.oldphoto-form select:hover {
    border-color: var(--primary);
}

.oldphoto-form input[type="file"]:focus,
.oldphoto-form select:focus {
    outline: none;
    border-color: var(--primary);
}

.oldphoto-form small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 13px;
}

#animation-controls {
    padding: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 20px;
}

.cost-display {
    text-align: center;
    padding: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--primary);
    border-radius: 6px;
}

.cost-label {
    display: block;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 8px;
}

.cost-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    display: inline-block;
    margin: 0 8px;
}

.cost-currency {
    color: var(--text-light);
}

.oldphoto-button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.oldphoto-button:hover {
    background: var(--primary-dark);
}

.oldphoto-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Progress Bar */
.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--text-light);
    font-size: 14px;
}

/* Balance Widget */
.oldphoto-balance-widget {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.balance-card,
.stats-card {
    flex: 1;
    padding: 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.balance-card h3,
.stats-card h3 {
    margin: 0 0 20px 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
}

.balance-main {
    text-align: center;
    padding: 20px 0;
}

.balance-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    display: block;
    line-height: 1;
}

.balance-label {
    color: var(--text-light);
    font-size: 16px;
    margin-top: 8px;
}

.balance-action {
    display: block;
    text-align: center;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    margin-top: 20px;
    font-weight: 600;
    transition: background 0.2s;
}

.balance-action:hover {
    background: var(--primary-dark);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-light);
}

.stat-value {
    color: var(--text);
    font-weight: 600;
}

/* History Table */
.oldphoto-history-container {
    margin: 30px 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center !important;
    margin-bottom: 20px;
}

.history-header h3 {
    margin: 0;
    color: var(--text);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    font-size: 14px;
}

.oldphoto-history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.oldphoto-history-table th {
    background: var(--bg-alt);
    padding: 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
}

.oldphoto-history-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.oldphoto-history-table tr:last-child td {
    border-bottom: none;
}

.oldphoto-history-table tr:hover {
    background: var(--bg-alt);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-processing {
    background: #fef3c7;
    color: #92400e;
}

.status-pending {
    background: #dbeafe;
    color: #1e3a8a;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Action Buttons */
.action-download,
.action-view-status,
.action-rate-task {
    padding: 6px 14px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    display: inline-block;
    margin-right: 8px;
}

.action-download:hover,
.action-view-status:hover,
.action-rate-task:hover {
    background: var(--primary-dark);
}

/* Modal */
.oldphoto-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: var(--bg);
    margin: 10% auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    border: 1px solid var(--border);
    position: relative;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

/* Result Messages */
.result-success {
    padding: 20px;
    background: #d1fae5;
    border: 1px solid #10b981;
    border-radius: 6px;
    text-align: center;
}

.result-success h4 {
    color: #065f46;
    margin: 0 0 10px 0;
}

.result-error {
    padding: 20px;
    background: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: 6px;
    text-align: center;
}

.result-error h4 {
    color: #991b1b;
    margin: 0 0 10px 0;
}

.error-text {
    color: var(--error);
    font-size: 13px;
}

.no-history {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .oldphoto-balance-widget {
        flex-direction: column;
    }
    
    .history-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .oldphoto-history-table {
        font-size: 13px;
    }
    
    .oldphoto-history-table td,
    .oldphoto-history-table th {
        padding: 10px;
    }
}

/* Login Prompt */
.oldphoto-login-prompt,
.oldphoto-error {
    padding: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    color: var(--text-light);
}

/* Notification */
.oldphoto-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2c5aa0;
    color: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
}

.oldphoto-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.error-box {
    padding: 10px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 4px;
    margin-top: 10px;
}

/* Feedback Modal */
#feedback-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

#feedback-modal .modal-content {
    background: #fff;
    margin: 10% auto;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
}

.star-rating { text-align: center; margin: 20px 0; }
.star-rating .star { font-size: 36px; color: #e5e7eb; cursor: pointer; margin: 0 5px; }
.star-rating .star.active { color: #fbbf24; }
.star-rating .star:hover { transform: scale(1.1); }

#feedback-comment { width: 100%; padding: 12px; border: 1px solid #e5e7eb; border-radius: 6px; min-height: 80px; }
#feedback-submit { width: 100%; padding: 12px; background: #2563eb; color: #fff; border: none; border-radius: 6px; font-size: 16px; cursor: pointer; margin-top: 15px; }
#feedback-submit:hover { background: #1d4ed8; }

.feedback-success { padding: 15px; background: #d1fae5; color: #065f46; border-radius: 6px; text-align: center; }
.feedback-error { padding: 15px; background: #fee2e2; color: #991b1b; border-radius: 6px; text-align: center; }

/* Center Feedback Modal */
#feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999;
}

#feedback-modal .modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

/* Title */
.oldphoto-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 30px 0;
    line-height: 1.3;
}

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed #f59e0b;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fffbeb;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 24px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #d97706;
    background: #fef3c7;
}

.dropzone-icon {
    color: #f59e0b;
    margin-bottom: 16px;
}

.dropzone-icon svg {
    width: 64px;
    height: 64px;
}

.dropzone-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.dropzone-hint {
    color: var(--text-light);
    font-size: 14px;
    margin: 0 0 20px 0;
}

.dropzone-button {
    display: inline-block;
    padding: 12px 28px;
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.dropzone-button:hover {
    background: #d97706;
}

.dropzone-formats {
    color: var(--text-light);
    font-size: 13px;
    margin: 16px 0 0 0;
}

/* Preview Container */
.preview-container {
    position: relative;
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
}

#preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: var(--error);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.remove-image:hover {
    background: #dc2626;
}

.preview-filename {
    margin: 12px 0 0 0;
    color: var(--text-light);
    font-size: 14px;
}

/* Processing Modal */
.processing-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.processing-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.processing-stage h3,
.result-stage h3 {
    margin: 0 0 20px 0;
    color: var(--text);
    font-size: 24px;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#processing-status {
    color: var(--text-light);
    margin-bottom: 20px;
}

.processing-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-alt);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.processing-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.processing-percent {
    color: var(--primary);
    font-weight: 600;
    font-size: 18px;
}

.result-preview {
    margin: 20px 0;
}

#result-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-download {
    padding: 14px 28px;
    background: var(--success);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-download:hover {
    background: #059669;
}

.btn-close-modal {
    padding: 14px 28px;
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-close-modal:hover {
    background: var(--border);
}

/* Fix Modal Centering */
.processing-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    display: none;
    justify-content: center !important;
    align-items: center !important;
    z-index: 999999 !important;
}

.processing-modal-content {
    background: #fff !important;
    border-radius: 16px !important;
    padding: 40px !important;
    max-width: 550px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    text-align: center !important;
    position: relative !important;
}

/* Modal show state */
.processing-modal.show {
    display: flex !important;
}
