/* Certificate Verification - Frontend Styles */

:root {
    --cv-primary: #1e40af;
    --cv-primary-light: #3b82f6;
    --cv-success: #10b981;
    --cv-error: #ef4444;
    --cv-bg: #f9fafb;
    --cv-white: #ffffff;
    --cv-text: #1f2937;
    --cv-text-light: #6b7280;
    --cv-border: #e5e7eb;
    --cv-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --cv-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

/* Main Container */
.cv-verification-container {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-verification-card {
    background: var(--cv-white);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: var(--cv-shadow-lg);
    animation: cvFadeIn 0.5s ease-out;
}

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

/* Icon */
.cv-icon {
    text-align: center;
    margin-bottom: 32px;
    animation: cvPulse 2s infinite;
}

@keyframes cvPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

.cv-subtitle {
    font-size: 16px;
    color: var(--cv-text-light);
    text-align: center;
    margin: 0 0 40px 0;
    line-height: 1.6;
}

.cv-hint-small {
    font-size: 12px;
    color: var(--cv-text-light);
    margin: 6px 0 0 0;
    text-align: center;
}

/* Form */
.cv-form {
    margin-bottom: 24px;
}

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

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

.cv-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-family: inherit;
    border: 2px solid var(--cv-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: var(--cv-white);
    color: var(--cv-text);
    direction: ltr;
    text-align: center;
    font-weight: 500;
    letter-spacing: 1px;
}

.cv-input:focus {
    outline: none;
    border-color: var(--cv-primary);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.cv-input::placeholder {
    color: var(--cv-text-light);
    font-weight: 400;
}

/* Verify Button */
.cv-verify-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    background: linear-gradient(135deg, var(--cv-primary) 0%, var(--cv-primary-light) 100%);
    color: var(--cv-white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 14px 0 rgba(30, 64, 175, 0.4);
}

.cv-verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(30, 64, 175, 0.5);
}

.cv-verify-btn:active {
    transform: translateY(0);
}

.cv-verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cv-verify-btn svg {
    transition: transform 0.3s ease;
}

.cv-verify-btn:hover svg {
    transform: translateX(-4px);
}

/* Loading State */
.cv-verify-btn.loading {
    pointer-events: none;
}

.cv-verify-btn.loading span {
    opacity: 0;
}

.cv-verify-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--cv-white);
    border-radius: 50%;
    animation: cvSpin 0.8s linear infinite;
}

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

/* Message */
.cv-message {
    margin-top: 24px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    display: none;
    animation: cvSlideIn 0.3s ease-out;
}

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

.cv-message.show {
    display: block;
}

.cv-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.cv-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

/* Popup */
.cv-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: cvFadeIn 0.3s ease-out;
}

.cv-popup.show {
    display: flex;
}

.cv-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.cv-popup-content {
    position: relative;
    background: var(--cv-white);
    border-radius: 20px;
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: cvZoomIn 0.3s ease-out;
}

@keyframes cvZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cv-popup-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--cv-white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-popup-close:hover {
    background: var(--cv-error);
    transform: rotate(90deg);
}

.cv-popup-body {
    padding: 20px;
    max-height: 85vh;
    overflow: auto;
}

.cv-popup-body img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .cv-verification-container {
        padding: 20px 16px;
    }
    
    .cv-verification-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .cv-title {
        font-size: 24px;
    }
    
    .cv-subtitle {
        font-size: 14px;
    }
    
    .cv-input {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .cv-verify-btn {
        padding: 14px 24px;
        font-size: 16px;
    }
    
    .cv-popup-content {
        max-width: 95%;
    }
}

/* Print Styles */
@media print {
    .cv-verification-container {
        background: var(--cv-white);
    }
    
    .cv-verify-btn,
    .cv-message {
        display: none;
    }
}
