/* Event Management System - Public Styles */

/* General Styles */
.ems-registration-container,
.ems-scanner-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ems-form-title,
.ems-scanner-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

/* Form Styles */
.ems-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.ems-form-row {
    margin-bottom: 20px;
}

.ems-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.ems-form-row .required {
    color: #e74c3c;
}

.ems-form-row input,
.ems-form-row select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.ems-form-row input:focus,
.ems-form-row select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.ems-submit-btn {
    width: 100%;
    background: #0073aa;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.ems-submit-btn:hover {
    background: #005a87;
}

.ems-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ems-submit-btn .btn-loading {
    display: none;
}

.ems-submit-btn.loading .btn-text {
    display: none;
}

.ems-submit-btn.loading .btn-loading {
    display: inline;
}

.ems-form-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.ems-form-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Message Styles */
.ems-message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: 500;
}

.ems-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ems-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ems-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.ems-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Success Message Styles */
.ems-success-message {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid #e1e5e9;
}

.ems-success-icon {
    width: 60px;
    height: 60px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
    margin: 0 auto 20px;
}

.ems-success-message h3 {
    color: #28a745;
    margin-bottom: 15px;
    font-size: 24px;
}

.ems-success-details {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.ems-download-badge {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.ems-download-badge:hover {
    background: #005a87;
    color: white;
}

.ems-event-details {
    margin-top: 20px;
    text-align: left;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
}

.ems-event-details h4 {
    margin-top: 0;
    color: #333;
}

/* Scanner Styles */
.ems-scanner-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.ems-scanner-controls {
    text-align: center;
    margin-bottom: 20px;
}

.ems-scanner-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 0 10px;
}

.ems-scanner-btn:hover {
    background: #005a87;
}

.ems-scanner-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#ems-scanner-video-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#ems-scanner-video {
    width: 100%;
    height: auto;
    display: block;
}

.ems-scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ems-scanner-frame {
    width: 200px;
    height: 200px;
    border: 3px solid #0073aa;
    border-radius: 8px;
    background: rgba(0, 115, 170, 0.1);
    position: relative;
}

.ems-scanner-frame::before,
.ems-scanner-frame::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid #0073aa;
}

.ems-scanner-frame::before {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.ems-scanner-frame::after {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

.ems-scanner-instruction {
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Scanner Result Styles */
.ems-scanner-result {
    margin-top: 20px;
}

.ems-result-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.ems-checkin-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.ems-checkin-success .ems-success-icon {
    background: #28a745;
    margin-bottom: 15px;
}

.ems-checkin-error,
.ems-checkin-warning {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.ems-checkin-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.ems-checkin-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}

.ems-error-icon {
    width: 60px;
    height: 60px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
    margin: 0 auto 15px;
}

.ems-checkin-warning .ems-error-icon {
    background: #ffc107;
    color: #333;
}

.ems-attendee-info {
    margin: 15px 0;
    text-align: left;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 6px;
}

.ems-attendee-info p {
    margin: 8px 0;
}

/* Role Badges */
.ems-role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ems-role-badge.visiteur {
    background: #e3f2fd;
    color: #1565c0;
}

.ems-role-badge.speaker {
    background: #f3e5f5;
    color: #7b1fa2;
}

.ems-role-badge.exposant {
    background: #e8f5e8;
    color: #2e7d32;
}

/* Scanner Info */
.ems-scanner-info {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.ems-scanner-info h4 {
    margin-top: 0;
    color: #333;
}

.ems-scanner-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ems-scanner-info li {
    margin: 8px 0;
    color: #666;
}

/* Manual Check-in */
.ems-manual-checkin {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.ems-manual-checkin h4 {
    margin-top: 0;
    color: #333;
}

.ems-manual-checkin .ems-form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.ems-manual-checkin input {
    flex: 1;
    margin-bottom: 0;
}

.ems-manual-checkin button {
    flex-shrink: 0;
    margin-bottom: 0;
    white-space: nowrap;
}

/* Loading Animation */
.ems-loading {
    position: relative;
    opacity: 0.7;
}

.ems-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .ems-registration-container,
    .ems-scanner-container {
        padding: 15px;
    }
    
    .ems-form,
    .ems-scanner-section,
    .ems-manual-checkin {
        padding: 20px;
    }
    
    .ems-form-title,
    .ems-scanner-title {
        font-size: 24px;
    }
    
    .ems-scanner-frame {
        width: 150px;
        height: 150px;
    }
    
    .ems-manual-checkin .ems-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .ems-manual-checkin input,
    .ems-manual-checkin button {
        width: 100%;
    }
    
    .ems-scanner-btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .ems-form-row input,
    .ems-form-row select,
    .ems-submit-btn,
    .ems-scanner-btn {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .ems-success-message,
    .ems-result-content {
        padding: 20px;
    }
    
    .ems-success-icon,
    .ems-error-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* Print Styles */
@media print {
    .ems-scanner-container,
    .ems-scanner-controls,
    .ems-scanner-btn,
    .ems-manual-checkin {
        display: none !important;
    }
    
    .ems-success-message,
    .ems-result-content {
        box-shadow: none;
        border: 1px solid #000;
    }
}

