/* Miplanhoy Event Submission - Public Styles */
/* Mobile-first approach */

:root {
    --mpes-primary: #2563eb;
    --mpes-primary-dark: #1d4ed8;
    --mpes-secondary: #64748b;
    --mpes-success: #10b981;
    --mpes-error: #ef4444;
    --mpes-warning: #f59e0b;
    --mpes-background: #ffffff;
    --mpes-surface: #f8fafc;
    --mpes-border: #e2e8f0;
    --mpes-text: #1e293b;
    --mpes-text-light: #64748b;
    --mpes-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --mpes-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --mpes-radius: 12px;
    --mpes-radius-sm: 8px;
}

/* Container */
.mpes-form-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--mpes-text);
}

/* Progress Bar */
.mpes-progress-bar {
    height: 4px;
    background: var(--mpes-border);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}

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

/* Progress Steps */
.mpes-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.mpes-progress-steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 24px;
    right: 24px;
    height: 2px;
    background: var(--mpes-border);
    z-index: 0;
}

.mpes-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.mpes-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mpes-surface);
    border: 2px solid var(--mpes-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--mpes-text-light);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.mpes-step.active .mpes-step-number {
    background: var(--mpes-primary);
    border-color: var(--mpes-primary);
    color: white;
}

.mpes-step-label {
    font-size: 12px;
    color: var(--mpes-text-light);
    font-weight: 500;
    text-align: center;
}

.mpes-step.active .mpes-step-label {
    color: var(--mpes-text);
}

/* Form Header */
.mpes-form-header {
    text-align: center;
    margin-bottom: 32px;
}

.mpes-form-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
}

.mpes-form-description {
    color: var(--mpes-text-light);
    margin: 0;
    font-size: 14px;
}

/* OCR Section */
.mpes-ocr-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--mpes-radius);
    padding: 24px;
    margin-bottom: 24px;
    color: white;
    text-align: center;
}

.mpes-ocr-upload {
    display: block;
}

.mpes-ocr-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.mpes-ocr-section h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}

.mpes-ocr-section p {
    margin: 0 0 20px;
    opacity: 0.9;
    font-size: 14px;
}

.mpes-btn-upload {
    display: inline-block;
    background: white;
    color: #764ba2;
    padding: 12px 24px;
    border-radius: var(--mpes-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.mpes-btn-upload:active {
    transform: scale(0.98);
}

.mpes-ocr-loading {
    padding: 20px;
}

.mpes-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.mpes-ocr-success {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 16px;
    border-radius: var(--mpes-radius-sm);
    margin-top: 16px;
}

/* Divider */
.mpes-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 32px 0;
    color: var(--mpes-text-light);
    font-size: 14px;
}

.mpes-divider::before,
.mpes-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--mpes-border);
}

.mpes-divider span {
    padding: 0 16px;
}

/* Form Steps */
.mpes-form-step {
    display: none;
}

.mpes-form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Form Groups */
.mpes-form-group {
    margin-bottom: 24px;
}

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

.mpes-label.required::after {
    content: ' *';
    color: var(--mpes-error);
}

.mpes-input,
.mpes-textarea,
.mpes-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--mpes-border);
    border-radius: var(--mpes-radius-sm);
    font-size: 16px; /* Prevents zoom on iOS */
    font-family: inherit;
    transition: all 0.2s;
    background: var(--mpes-background);
    -webkit-appearance: none;
    appearance: none;
}

.mpes-input:focus,
.mpes-textarea:focus,
.mpes-select:focus {
    outline: none;
    border-color: var(--mpes-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.mpes-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Input States */
.mpes-input.error,
.mpes-textarea.error,
.mpes-select.error {
    border-color: var(--mpes-error);
}

.mpes-input.success,
.mpes-textarea.success,
.mpes-select.success {
    border-color: var(--mpes-success);
}

.mpes-field-error {
    color: var(--mpes-error);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.mpes-field-error.show {
    display: block;
}

.mpes-field-hint {
    color: var(--mpes-text-light);
    font-size: 13px;
    margin-top: 6px;
}

/* Form Row */
.mpes-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Textarea Variations */
.mpes-textarea-short {
    min-height: 60px;
    resize: vertical;
}

/* Section Title */
.mpes-form-section-title {
    font-weight: 600;
    font-size: 16px;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--mpes-border);
}

/* Images Upload - Multiple */
.mpes-images-upload-area {
    border: 2px dashed var(--mpes-border);
    border-radius: var(--mpes-radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--mpes-surface);
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mpes-images-upload-area:hover {
    border-color: var(--mpes-primary);
    background: rgba(37, 99, 235, 0.05);
}

.mpes-images-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.mpes-image-item {
    position: relative;
    border-radius: var(--mpes-radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--mpes-surface);
    border: 2px solid var(--mpes-border);
}

.mpes-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mpes-image-item.primary::after {
    content: '★ Principal';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    padding: 4px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.mpes-remove-image-multiple {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mpes-remove-image-multiple:hover {
    background: rgba(239, 68, 68, 0.9);
}

.mpes-image-uploading {
    opacity: 0.5;
}

.mpes-image-uploading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Image Upload */
.mpes-image-upload-area {
    border: 2px dashed var(--mpes-border);
    border-radius: var(--mpes-radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--mpes-surface);
}

.mpes-image-upload-area:hover {
    border-color: var(--mpes-primary);
    background: rgba(37, 99, 235, 0.05);
}

.mpes-upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.mpes-upload-placeholder p {
    margin: 0 0 8px;
    font-weight: 500;
}

.mpes-upload-hint {
    font-size: 13px;
    color: var(--mpes-text-light);
}

.mpes-image-preview {
    position: relative;
    border-radius: var(--mpes-radius-sm);
    overflow: hidden;
}

.mpes-image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.mpes-remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.mpes-remove-image:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Buttons */
.mpes-btn {
    padding: 14px 24px;
    border-radius: var(--mpes-radius-sm);
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-block;
    text-align: center;
}

.mpes-btn-primary {
    background: var(--mpes-primary);
    color: white;
}

.mpes-btn-primary:hover {
    background: var(--mpes-primary-dark);
}

.mpes-btn-primary:active {
    transform: scale(0.98);
}

.mpes-btn-secondary {
    background: var(--mpes-surface);
    color: var(--mpes-text);
    border: 2px solid var(--mpes-border);
}

.mpes-btn-secondary:hover {
    background: var(--mpes-border);
}

.mpes-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Actions */
.mpes-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.mpes-form-actions .mpes-btn {
    flex: 1;
}

/* Preview Card */
.mpes-preview-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.mpes-preview-card {
    background: var(--mpes-surface);
    border-radius: var(--mpes-radius);
    overflow: hidden;
    margin-bottom: 24px;
    border: 2px solid var(--mpes-border);
}

.mpes-preview-image {
    width: 100%;
    height: 200px;
    background: var(--mpes-border);
    background-size: cover;
    background-position: center;
}

.mpes-preview-content {
    padding: 20px;
}

.mpes-preview-event-title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 700;
}

.mpes-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--mpes-text-light);
}

.mpes-preview-meta > div::before {
    margin-right: 8px;
}

.mpes-preview-date::before {
    content: '📅';
}

.mpes-preview-location::before {
    content: '📍';
}

.mpes-preview-price::before {
    content: '💰';
}

.mpes-preview-description {
    color: var(--mpes-text);
    line-height: 1.6;
}

/* Success Message */
.mpes-success-message {
    text-align: center;
    padding: 48px 24px;
    max-width: 600px;
    margin: 0 auto;
}

.mpes-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 24px;
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.mpes-success-message h3 {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 700;
    color: var(--mpes-text);
}

.mpes-success-lead {
    color: var(--mpes-text-light);
    font-size: 16px;
    margin: 0 0 24px;
}

.mpes-success-email-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--mpes-radius);
    padding: 16px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #1e40af;
}

.mpes-email-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.mpes-success-info {
    background: var(--mpes-surface);
    border-radius: var(--mpes-radius);
    padding: 32px 24px;
    margin-bottom: 32px;
    text-align: left;
}

.mpes-info-title {
    margin: 0 0 24px;
    font-weight: 700;
    font-size: 18px;
    text-align: center;
}

.mpes-timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mpes-timeline-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.mpes-timeline-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mpes-timeline-content {
    flex: 1;
}

.mpes-timeline-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
    color: var(--mpes-text);
}

.mpes-timeline-content p {
    margin: 0;
    font-size: 14px;
    color: var(--mpes-text-light);
    line-height: 1.5;
}

.mpes-success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.mpes-btn-large {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
}

.mpes-btn-icon {
    margin-right: 8px;
    font-size: 18px;
}

.mpes-success-actions .mpes-btn {
    min-width: 240px;
}

@media (max-width: 480px) {
    .mpes-success-message h3 {
        font-size: 24px;
    }
    
    .mpes-timeline-icon {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
}

/* Loading Overlay */
.mpes-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.mpes-loading-overlay .mpes-spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

.mpes-loading-overlay p {
    margin-top: 16px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 480px) {
    .mpes-form-wrapper {
        padding: 12px;
    }
    
    .mpes-form-row {
        grid-template-columns: 1fr;
    }
    
    .mpes-step-label {
        font-size: 11px;
    }
    
    .mpes-progress-steps::before {
        left: 16px;
        right: 16px;
    }
}

@media (min-width: 768px) {
    .mpes-form-wrapper {
        padding: 32px;
    }
    
    .mpes-image-upload-area {
        padding: 48px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) {
    .mpes-input,
    .mpes-textarea,
    .mpes-select,
    .mpes-btn {
        /* Larger touch targets on mobile */
        min-height: 44px;
    }
}
