/* Certificate Manager - Frontend Styles */

.cm-certificate-generator {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cm-generator-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cm-generator-header {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #ffffff;
    padding: 32px;
    text-align: center;
}

.cm-title {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
}

.cm-description {
    margin: 0;
    font-size: 16px;
    opacity: 0.95;
    line-height: 1.5;
}

.cm-generator-form {
    padding: 32px;
}

.cm-form-field {
    margin-bottom: 24px;
}

.cm-form-field label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 8px;
}

.cm-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.cm-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.cm-input::placeholder {
    color: #999;
}

.cm-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.cm-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.cm-btn-primary {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #ffffff;
}

.cm-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.3);
}

.cm-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.cm-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.cm-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.cm-btn-secondary:hover {
    background: #e0e0e0;
}

.cm-btn-text,
.cm-btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cm-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.cm-certificate-result {
    padding: 32px;
    background: #f9fafb;
}

.cm-result-header {
    text-align: center;
    margin-bottom: 24px;
}

.cm-result-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.cm-certificate-display {
    margin-bottom: 24px;
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cm-certificate-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cm-certificate-img:hover {
    transform: scale(1.02);
}

.cm-download-instructions {
    margin-bottom: 24px;
}

.cm-instruction-box {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #e3f2fd;
    border-radius: 8px;
}

.cm-instruction-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.cm-instruction-content h4 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #333;
}

.cm-instruction-content ul {
    margin: 0;
    padding-left: 20px;
}

.cm-instruction-content li {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 14px;
    color: #555;
}

.cm-instruction-content strong {
    color: #2271b1;
}

.cm-result-actions {
    text-align: center;
}

.cm-error-message {
    margin-top: 16px;
    padding: 16px;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    color: #c62828;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cm-certificate-generator {
        margin: 20px auto;
    }
    
    .cm-generator-header {
        padding: 24px 20px;
    }
    
    .cm-title {
        font-size: 24px;
    }
    
    .cm-description {
        font-size: 14px;
    }
    
    .cm-generator-form,
    .cm-certificate-result {
        padding: 24px 20px;
    }
    
    .cm-btn {
        font-size: 16px;
        padding: 14px 20px;
    }
    
    .cm-instruction-box {
        flex-direction: column;
        text-align: center;
    }
    
    .cm-instruction-content {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .cm-certificate-generator {
        padding: 0 10px;
    }
    
    .cm-title {
        font-size: 20px;
    }
    
    .cm-input {
        font-size: 14px;
        padding: 12px 14px;
    }
    
    .cm-btn {
        font-size: 15px;
    }
}

/* Print styles */
@media print {
    .cm-generator-header,
    .cm-generator-form,
    .cm-download-instructions,
    .cm-result-actions,
    .cm-error-message {
        display: none !important;
    }
    
    .cm-certificate-result {
        padding: 0;
        background: transparent;
    }
    
    .cm-certificate-display {
        box-shadow: none;
        padding: 0;
    }
}

/* Accessibility */
.cm-input:focus-visible,
.cm-btn:focus-visible {
    outline: 3px solid #2271b1;
    outline-offset: 2px;
}

/* Loading state */
.cm-loading {
    position: relative;
    pointer-events: none;
}

.cm-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}
