/* Certificate specific styles */
.certificate-main {
    padding: 120px 0 80px;
    min-height: 100vh;
    position: relative;
}

.certificate-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(600px circle at 10% 20%, rgba(102, 126, 234, 0.1), transparent 50%),
        radial-gradient(800px circle at 90% 30%, rgba(118, 75, 162, 0.1), transparent 50%),
        radial-gradient(1000px circle at 50% 90%, rgba(240, 147, 251, 0.08), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.certificate-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 4rem;
    box-shadow: 
        0 32px 80px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    margin-bottom: 3rem;
    z-index: 1;
    transition: all 0.3s ease;
}

.certificate-card:hover {
    box-shadow: 
        0 40px 100px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.certificate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 24px 24px 0 0;
    animation: gradientFlow 8s ease-in-out infinite;
}

.certificate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 3rem;
    border-bottom: 3px solid transparent;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.1) 50%, transparent 100%) bottom / 100% 3px no-repeat;
    margin-bottom: 3rem;
    position: relative;
}

.certificate-title {
    flex: 1;
    position: relative;
    padding: 1rem 0;
}

.certificate-title::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: certificateGlow 5s ease-in-out infinite;
}

.certificate-title h1 {
    font-size: 3.25rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 30%, #f093fb 70%, #667eea 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    position: relative;
    animation: certificateTextFlow 8s ease-in-out infinite;
    letter-spacing: -0.03em;
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.3);
}

.certificate-title h1::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1), rgba(240, 147, 251, 0.1));
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(20px);
}

.certificate-title h1:hover::before {
    opacity: 1;
}

.certificate-title h1::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 160px;
    height: 6px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    border-radius: 3px;
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.4),
        0 0 20px rgba(102, 126, 234, 0.2);
    animation: certificateUnderline 4s ease-in-out infinite;
}

.certificate-title .cert-subtitle {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 50px;
    color: #667eea;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.certificate-title .cert-subtitle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.certificate-title .cert-subtitle:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.25);
}

.certificate-title .cert-subtitle:hover::before {
    left: 100%;
}

.certificate-title p {
    color: #6b7280;
    font-size: 1.375rem;
    font-weight: 500;
    margin-top: 2rem;
    position: relative;
    opacity: 0.95;
    line-height: 1.6;
}

.certificate-badge {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    box-shadow: 
        0 20px 40px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: badgeGlow 4s ease-in-out infinite;
    position: relative;
    margin-left: 2rem;
}

.certificate-badge::before {
    content: '';
    position: absolute;
    width: 140%;
    height: 140%;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    animation: badgeRipple 3s ease-out infinite;
}

.certificate-badge::after {
    content: '';
    position: absolute;
    width: 110%;
    height: 110%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.certificate-body {
    display: grid;
    gap: 2rem;
}

.certificate-section {
    padding: 2rem 0;
    position: relative;
}

.certificate-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    position: relative;
}

.certificate-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.details-grid,
.proof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.detail {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid transparent;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    opacity: 0.8;
}

.detail:hover {
    border-color: rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 40px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.detail .label {
    display: block;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.detail .value {
    color: #1f2937;
    font-weight: 700;
    font-size: 1.125rem;
    word-break: break-all;
    line-height: 1.4;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.certificate-section p {
    color: #4b5563;
    line-height: 1.7;
    text-align: justify;
}

.certificate-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 3px solid transparent;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.1) 50%, transparent 100%) top / 100% 3px no-repeat;
    position: relative;
}

.signature-block {
    text-align: left;
    position: relative;
}

.signature-line {
    width: 320px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    margin-bottom: 1rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.signature-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 3s infinite;
}

.signature-label {
    color: #6b7280;
    font-size: 1rem;
    font-weight: 600;
    font-style: italic;
}

.qr-block {
    text-align: center;
    position: relative;
}

.qr-block canvas {
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.qr-block canvas:hover {
    border-color: #667eea;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.qr-block .small {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.certificate-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

.certificate-actions .btn {
    min-width: 200px;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.certificate-actions .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    z-index: 0;
}

.certificate-actions .btn:hover::before {
    width: 300px;
    height: 300px;
}

.certificate-actions .btn span,
.certificate-actions .btn i {
    position: relative;
    z-index: 1;
}

/* Print styles */
@media print {
    .header,
    .certificate-actions {
        display: none !important;
    }
    
    .certificate-main {
        padding: 0;
        background: white !important;
    }
    
    .certificate-card {
        box-shadow: none;
        border: 2px solid #000;
        page-break-inside: avoid;
    }
}

/* Animations */
@keyframes badgeGlow {
    0%, 100% {
        box-shadow: 
            0 20px 40px rgba(102, 126, 234, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 
            0 25px 50px rgba(102, 126, 234, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
        transform: scale(1.02);
    }
}

@keyframes badgeRipple {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.4);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes certificateGlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@keyframes certificateTextFlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes certificateUnderline {
    0%, 100% {
        transform: scaleX(1);
        opacity: 0.8;
    }
    50% {
        transform: scaleX(1.1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .certificate-card {
        padding: 2.5rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .certificate-header {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding-bottom: 2rem;
    }
    
    .certificate-title h1 {
        font-size: 2.25rem;
    }
    
    .certificate-title h1::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .certificate-badge {
        width: 100px;
        height: 100px;
        font-size: 2rem;
        margin-left: 0;
    }
    
    .certificate-footer {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
        margin-top: 3rem;
        padding-top: 2rem;
    }
    
    .signature-line {
        width: 250px;
        margin: 0 auto 0.75rem;
    }
    
    .certificate-actions {
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .certificate-actions .btn {
        min-width: auto;
        width: 100%;
    }
    
    .details-grid,
    .proof-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .detail {
        padding: 1.5rem;
    }
    
    .certificate-section h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .certificate-card {
        padding: 2rem 1rem;
        border-radius: 20px;
    }
    
    .certificate-title h1 {
        font-size: 1.875rem;
    }
    
    .certificate-title p {
        font-size: 1rem;
    }
    
    .certificate-badge {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }
    
    .detail {
        padding: 1.25rem;
    }
    
    .detail .value {
        font-size: 1rem;
    }
}
    .certificate-card {
        padding: 2rem 1.5rem;
    }
    
    .certificate-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .certificate-footer {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .signature-line {
        width: 200px;
        margin: 0 auto 0.5rem;
    }
    
    .certificate-actions {
        flex-direction: column;
    }
    
    .details-grid,
    .proof-grid {
        grid-template-columns: 1fr;
    }
