/**
 * Public Styles for Certificate Verification Plugin
 */

/* Base Styles */
.bricks-cert-verification-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

.bricks-cert-title {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2em;
    font-weight: 600;
    line-height: 1.2;
}

.bricks-cert-description {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1em;
    line-height: 1.5;
}

/* Form Styles */
.bricks-cert-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
    transition: box-shadow 0.3s ease;
}

.bricks-cert-form:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

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

.bricks-cert-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.4;
}

.bricks-cert-label .required {
    color: #e74c3c;
    margin-left: 4px;
    font-weight: bold;
}

.bricks-cert-input,
.bricks-cert-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #2c3e50;
    box-sizing: border-box;
}

.bricks-cert-input:focus,
.bricks-cert-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.bricks-cert-input::placeholder {
    color: #95a5a6;
    opacity: 1;
}

.bricks-cert-input.error,
.bricks-cert-select.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

/* Button Styles */
.bricks-cert-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.bricks-cert-button {
    flex: 1;
    min-width: 150px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.bricks-cert-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.bricks-cert-button:hover::before {
    left: 100%;
}

.bricks-cert-button-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.bricks-cert-button-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    color: white;
    text-decoration: none;
}

.bricks-cert-button-secondary {
    background: #ffffff;
    color: #2c3e50;
    border: 2px solid #e1e8ed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bricks-cert-button-secondary:hover {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bricks-cert-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.bricks-cert-button:disabled::before {
    display: none;
}

/* Loading Spinner */
.loading-spinner {
    animation: spin 1s linear infinite;
}

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

/* Modal Styles */
.bricks-cert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bricks-cert-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.bricks-cert-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.bricks-cert-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.bricks-cert-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.bricks-cert-modal-close:hover {
    color: #e74c3c;
    background: #f8f9fa;
}

.bricks-cert-modal-body {
    padding: 20px;
    text-align: center;
}

#bricks-cert-qr-reader {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bricks-cert-qr-instructions {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

/* Results and Error Styles */
.bricks-cert-results,
.bricks-cert-error {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

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

.bricks-cert-results {
    background: linear-gradient(135deg, #d5f4e6, #c8e6c9);
    border: 1px solid #27ae60;
    color: #27ae60;
}

.bricks-cert-error {
    background: linear-gradient(135deg, #fdf2f2, #ffebee);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

/* Success State Styles */
.bricks-cert-success {
    text-align: center;
}

.bricks-cert-success .success-icon {
    margin-bottom: 15px;
}

.bricks-cert-success .success-icon svg {
    width: 48px;
    height: 48px;
}

.bricks-cert-success h3 {
    color: #27ae60;
    margin: 0 0 15px 0;
    font-size: 1.5em;
    font-weight: 600;
}

.certificate-preview {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: left;
    border: 1px solid #27ae60;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.1);
}

.certificate-preview h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.certificate-preview p {
    margin: 8px 0;
    color: #2c3e50;
    font-size: 14px;
}

.status-valid {
    color: #27ae60;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

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

.view-full-certificate,
.print-certificate {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.view-full-certificate:hover,
.print-certificate:hover {
    background: #2980b9;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Error State Styles */
.bricks-cert-error-message {
    text-align: center;
}

.bricks-cert-error-message .error-icon {
    margin-bottom: 15px;
}

.bricks-cert-error-message .error-icon svg {
    width: 48px;
    height: 48px;
}

.bricks-cert-error-message p {
    color: #e74c3c;
    margin: 0;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
}

/* Certificate Display Styles */
.bricks-cert-result-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bricks-cert-result-header {
    text-align: center;
    margin-bottom: 40px;
}

.bricks-cert-success-icon {
    margin-bottom: 20px;
}

.bricks-cert-success-icon svg {
    width: 64px;
    height: 64px;
}

.bricks-cert-result-title {
    color: #27ae60;
    font-size: 2.5em;
    margin: 0 0 10px 0;
    font-weight: 600;
    line-height: 1.2;
}

.bricks-cert-result-subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
    margin: 0;
    line-height: 1.4;
}

.bricks-cert-certificate-display {
    margin: 30px 0;
}

.bricks-cert-certificate {
    border-radius: 12px;
    position: relative;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    font-family: 'Times New Roman', serif;
    line-height: 1.6;
    overflow: hidden;
}

.certificate-header {
    text-align: center;
    margin-bottom: 30px;
}

.certificate-header h2 {
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: normal;
}

.certificate-header h1 {
    font-size: 2.5em;
    margin: 0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.certificate-body {
    text-align: center;
    margin: 40px 0;
}

.certificate-body p {
    font-size: 1.1em;
    margin: 15px 0;
}

.holder-name {
    font-size: 2em;
    font-weight: bold;
    margin: 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.course-name {
    font-size: 1.5em;
    font-weight: bold;
    margin: 20px 0;
}

.certificate-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 40px;
}

.signature-section {
    flex: 1;
}

.signature-line {
    width: 200px;
    height: 1px;
    margin-bottom: 5px;
}

.certificate-number {
    text-align: right;
    font-size: 0.9em;
}

.qr-code-section {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

.certificate-qr {
    width: 80px;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Action Buttons */
.bricks-cert-result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.bricks-cert-action-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.bricks-cert-action-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    color: white;
    text-decoration: none;
}

/* Verification Details */
.bricks-cert-verification-details {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
    border: 1px solid #e1e8ed;
}

.bricks-cert-verification-details h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: 600;
}

.bricks-cert-details-table {
    width: 100%;
    border-collapse: collapse;
}

.bricks-cert-details-table td {
    padding: 12px 0;
    border-bottom: 1px solid #e1e8ed;
    vertical-align: top;
}

.bricks-cert-details-table td:first-child {
    width: 40%;
    font-weight: 600;
    color: #2c3e50;
}

.bricks-cert-back-to-verify {
    text-align: center;
    margin-top: 40px;
}

.bricks-cert-back-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bricks-cert-back-link:hover {
    color: #2980b9;
    text-decoration: none;
}

/* Print Styles */
@media print {
    .bricks-cert-result-actions,
    .bricks-cert-verification-details,
    .bricks-cert-back-to-verify,
    .bricks-cert-modal {
        display: none !important;
    }
    
    .bricks-cert-certificate {
        box-shadow: none;
        border: 2px solid #000;
        margin: 0;
        padding: 30px;
        page-break-inside: avoid;
    }
    
    .bricks-cert-result-page {
        padding: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .bricks-cert-verification-form {
        padding: 15px;
    }
    
    .bricks-cert-form {
        padding: 20px;
    }
    
    .bricks-cert-form-actions {
        flex-direction: column;
    }
    
    .bricks-cert-button {
        width: 100%;
        min-width: auto;
    }
    
    .bricks-cert-title {
        font-size: 1.5em;
    }
    
    .bricks-cert-result-title {
        font-size: 2em;
    }
    
    .bricks-cert-certificate {
        padding: 20px;
    }
    
    .certificate-header h1 {
        font-size: 2em;
    }
    
    .holder-name {
        font-size: 1.5em;
    }
    
    .certificate-footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .bricks-cert-result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .bricks-cert-action-button {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .bricks-cert-details-table td:first-child {
        width: 50%;
    }
}

@media (max-width: 480px) {
    .bricks-cert-verification-form {
        padding: 10px;
    }
    
    .bricks-cert-form {
        padding: 15px;
    }
    
    .bricks-cert-title {
        font-size: 1.3em;
    }
    
    .bricks-cert-result-title {
        font-size: 1.8em;
    }
    
    .bricks-cert-certificate {
        padding: 15px;
    }
    
    .certificate-header h1 {
        font-size: 1.8em;
    }
    
    .holder-name {
        font-size: 1.3em;
    }
    
    .bricks-cert-modal-content {
        width: 95%;
    }
    
    .bricks-cert-modal-header {
        padding: 15px;
    }
    
    .bricks-cert-modal-body {
        padding: 15px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bricks-cert-input,
    .bricks-cert-select {
        border-width: 3px;
    }
    
    .bricks-cert-button {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bricks-cert-button,
    .bricks-cert-input,
    .bricks-cert-select,
    .bricks-cert-modal,
    .bricks-cert-results,
    .bricks-cert-error {
        transition: none;
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
.bricks-cert-button:focus,
.bricks-cert-input:focus,
.bricks-cert-select:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bricks-cert-form {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .bricks-cert-label {
        color: #ecf0f1;
    }
    
    .bricks-cert-input,
    .bricks-cert-select {
        background: #34495e;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .bricks-cert-input::placeholder {
        color: #95a5a6;
    }
    
    .bricks-cert-button-secondary {
        background: #34495e;
        color: #ecf0f1;
        border-color: #34495e;
    }
    
    .bricks-cert-modal-content {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .bricks-cert-modal-header {
        background: #34495e;
        border-color: #34495e;
    }
}
