/**
 * Public-facing CSS for Natiga Certificates plugin
 */

/* RTL support */
.natiga-search-container,
.natiga-certificate-container,
.natiga-no-results {
    direction: rtl;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    text-align: right;
}

/* Search form */
.natiga-search-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.natiga-search-form h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
    text-align: center;
}

.natiga-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.natiga-form-group {
    position: relative;
}

.natiga-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.natiga-input:focus {
    border-color: #4caf50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.natiga-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    background-color: #4caf50;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.natiga-button:hover {
    background-color: #45a049;
}

.natiga-button-icon {
    display: flex;
    align-items: center;
}

/* Loading indicator */
.natiga-loading {
    text-align: center;
    margin-top: 20px;
}

.natiga-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(76, 175, 80, 0.3);
    border-radius: 50%;
    border-top-color: #4caf50;
    animation: natiga-spin 1s linear infinite;
}

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

/* Results */
.natiga-results {
    margin-top: 20px;
}

.natiga-error {
    padding: 15px;
    border-radius: 6px;
    background-color: #ffebee;
    color: #e53935;
    text-align: center;
}

/* Certificate result */
.natiga-certificate-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.natiga-certificate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.natiga-certificate-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.natiga-print-button {
    background-color: #2196F3;
}

.natiga-print-button:hover {
    background-color: #0b7dda;
}

.natiga-certificate-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
}

.natiga-certificate-details {
    flex: 1;
}

.natiga-certificate-image {
    margin-bottom: 20px;
}

.natiga-certificate-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.natiga-info-item {
    margin-bottom: 15px;
}

.natiga-info-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.natiga-info-value {
    font-size: 16px;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.natiga-certificate-body {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.natiga-certificate-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.natiga-qr-text {
    font-size: 14px;
    color: #777;
    text-align: center;
}

/* QR Code styles */
.natiga-certificate-qr {
    text-align: center;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 180px;
}

.natiga-qrcode-container {
    margin: 15px auto;
    padding: 10px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: inline-block;
    border: 1px solid #eee;
}

.natiga-qr-text {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    text-align: center;
}

.natiga-qr-download {
    margin-top: 10px;
}

.natiga-download-button {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.3s;
    width: 100%;
    max-width: 150px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 500;
    margin-top: 5px;
}

.natiga-download-button:hover {
    background-color: #45a049;
    color: white;
    text-decoration: none;
}

.natiga-error {
    color: #e53935;
    font-size: 14px;
    padding: 10px;
    margin: 10px 0;
    background-color: #ffebee;
    border-radius: 4px;
}

/* No results */
.natiga-no-results {
    max-width: 500px;
    margin: 30px auto;
    padding: 30px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.natiga-no-results-icon {
    margin-bottom: 15px;
}

.natiga-no-results h3 {
    font-size: 22px;
    color: #333;
    margin: 0 0 15px;
}

.natiga-no-results p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.natiga-no-results-actions {
    margin-top: 20px;
}

.natiga-back-button {
    background-color: #3498db;
}

.natiga-back-button:hover {
    background-color: #2980b9;
}

/* Print styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .natiga-certificate-container,
    .natiga-certificate-container * {
        visibility: visible;
    }
    
    .natiga-certificate-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 15px;
        box-shadow: none;
    }
    
    .natiga-print-button {
        display: none;
    }
    
    @page {
        size: A4;
        margin: 1cm;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .natiga-certificate-content {
        flex-direction: column;
    }
    
    .natiga-certificate-qr {
        margin-top: 30px;
        padding-top: 20px;
        border-top: 1px solid #eee;
    }
}

/* Mobile QR scan specific styles - added for better mobile viewing */
@media (max-width: 480px) {
    .natiga-certificate-container {
        padding: 15px;
        margin: 10px;
        box-shadow: none;
        border: 1px solid #eee;
    }
    
    .natiga-certificate-header h2 {
        font-size: 18px;
    }
    
    .natiga-info-item {
        margin-bottom: 10px;
        display: block !important;
        visibility: visible !important;
    }
    
    .natiga-info-label {
        font-weight: bold;
        display: block;
    }
    
    .natiga-info-value {
        display: block;
        padding: 5px 8px;
    }
    
    .natiga-certificate-body {
        margin-top: 15px;
        padding-top: 15px;
    }
    
    /* Force display for critical elements */
    .natiga-certificate-details,
    .natiga-certificate-info,
    .natiga-info-item,
    .natiga-certificate-body {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Style specifically for mobile QR scans */
.mobile-qr-scan .natiga-certificate-container {
    max-width: 100%;
    margin: 0;
    padding: 10px;
}

.mobile-qr-scan .natiga-certificate-qr {
    display: none; /* Hide QR code on mobile scan view */
}

.mobile-qr-scan .natiga-certificate-details {
    margin-bottom: 0;
}
