/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Playfair+Display:wght@700&family=Great+Vibes&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #e0e4ec 0%, #c8ceda 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.25' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.certificate-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 10px;
}

.certificate {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.2),
        0 -8px 20px rgba(58, 112, 209, 0.15),
        0 0 0 5px rgba(58, 112, 209, 0.1);
    padding: 40px;
    position: relative;
    overflow: hidden;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)),
        url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e6e6e6' fill-opacity='0.4'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    border: 20px solid transparent;
    border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%234481eb' fill-opacity='0.25'%3E%3Cpath d='M0 0h20v20H0V0zm0 80h20v20H0V80zm80 0h20v20H80V80zm0-80h20v20H80V0z M20 20h20v20H20V20zm0 60h20v20H20V80zm60 0h20v20H80V80zm0-60h20v20H80V20zM40 40h20v20H40V40zm0 40h20v20H40V80zm40-40h20v20H80V40z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 20;
}

.certificate::before {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 200 200'%3E%3Cpath fill='none' stroke='%234481eb' stroke-width='2' stroke-opacity='0.2' d='M100,10 C40,10 10,40 10,100 C10,150 40,190 100,190 C150,190 190,150 190,100 C190,40 150,10 100,10 M100,0 C150,0 200,50 200,100 C200,150 150,200 100,200 C50,200 0,150 0,100 C0,50 50,0 100,0'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.certificate::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 7px;
    background: linear-gradient(90deg, #3a70d1, #04befe);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    z-index: 2;
}

.certificate-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    width: 80%;
    height: 300px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='500' height='100' viewBox='0 0 500 100'%3E%3Ctext x='250' y='50' font-family='Arial' font-size='40' font-weight='bold' fill='none' stroke='%234481eb' stroke-width='1' stroke-opacity='0.1' text-anchor='middle' dominant-baseline='middle'%3ESOFTONIC INSTITUTE%3C/text%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-top: 30px;
}

.certificate-emblem {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
    background: linear-gradient(135deg, #3a70d1, #04befe);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(68, 129, 235, 0.3);
    z-index: 1;
}

.certificate-emblem::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.certificate-emblem::after {
    content: 'S';
    font-family: 'Great Vibes', cursive;
    font-size: 40px;
    color: #3a70d1;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
    position: relative;
    top: -2px;
}

.certificate-ribbon {
    position: relative;
    margin: 20px auto 10px;
    max-width: 300px;
}

.certificate-ribbon span {
    display: inline-block;
    position: relative;
    padding: 6px 25px;
    background: linear-gradient(90deg, #3a70d1, #04befe);
    color: white;
    font-size: 0.9rem;
    letter-spacing: 1px;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.certificate-ribbon span::before,
.certificate-ribbon span::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    bottom: -10px;
    border-style: solid;
}

.certificate-ribbon span::before {
    left: 0;
    border-width: 10px 0 0 10px;
    border-color: transparent transparent transparent #04befe;
}

.certificate-ribbon span::after {
    right: 0;
    border-width: 10px 10px 0 0;
    border-color: transparent #4481eb transparent transparent;
}

.header::before,
.header::after {
    content: '';
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4481eb, transparent);
    width: 60%;
    left: 20%;
}

.header::before {
    top: -15px;
}

.header::after {
    bottom: -15px;
}

.header h1 {
    font-family: 'Playfair Display', serif;
    color: #2a2a2a;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

.header h1::before,
.header h1::after {
    content: '❖';
    font-size: 1.5rem;
    color: #3a70d1;
    opacity: 0.7;
    margin: 0 15px;
    vertical-align: middle;
}

.header h2 {
    color: #444;
    font-size: 1.5rem;
    font-weight: 500;
    position: relative;
    display: inline-block;
    padding: 0 15px;
}

.header h2::before,
.header h2::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 1px;
    background-color: #666;
    top: 50%;
}

.header h2::before {
    left: -30px;
}

.header h2::after {
    right: -30px;
}

.photo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
}

.photo-container::before {
    content: '';
    position: absolute;
    width: 170px;
    height: 200px;
    border: 2px solid rgba(68, 129, 235, 0.2);
    border-radius: 10px;
    z-index: 0;
    transform: rotate(-3deg);
}

.student-photo {
    width: 150px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 5px solid #f8f9fa;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.certificate-details {
    margin-bottom: 30px;
    position: relative;
}

.certificate-details::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cpath fill='none' stroke='%234481eb' stroke-width='1.5' stroke-opacity='0.1' d='M50,50 C75,25 125,25 150,50 C175,75 175,125 150,150 C125,175 75,175 50,150 C25,125 25,75 50,50 Z'/%3E%3C/svg%3E");
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(68, 129, 235, 0.1);
}

tr {
    border-bottom: 1px solid #eaeaea;
    transition: all 0.3s ease;
}

tr:nth-child(even) {
    background-color: rgba(68, 129, 235, 0.02);
}

tr:hover {
    background-color: rgba(68, 129, 235, 0.05);
    transform: translateX(3px);
}

tr:last-child {
    border-bottom: none;
}

td {
    padding: 12px 15px;
    position: relative;
    overflow: hidden;
}

.label {
    font-weight: 600;
    color: #444;
    width: 25%;
    position: relative;
    background-color: rgba(68, 129, 235, 0.03);
    border-right: 1px solid rgba(68, 129, 235, 0.05);
}

.label::after {
    content: ':';
    position: absolute;
    right: 5px;
    color: #4481eb;
}

.value {
    color: #333;
    width: 25%;
    font-weight: 500;
}

.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(68, 129, 235, 0.3), transparent);
    top: -20px;
}

.signature {
    text-align: center;
    width: 300px;
    position: relative;
}

.signature::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath fill='none' stroke='%234481eb' stroke-width='1' stroke-opacity='0.2' d='M30,5 C15,5 5,15 5,30 C5,45 15,55 30,55 C45,55 55,45 55,30 C55,15 45,5 30,5 Z'/%3E%3C/svg%3E");
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    opacity: 0.5;
}

.sign-line {
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #333, transparent);
    margin: 0 auto 10px;
    position: relative;
}

.sign-line::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 1px;
    background-color: rgba(68, 129, 235, 0.3);
    bottom: -3px;
    left: 10%;
}

.signature p {
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

.signature p:first-of-type {
    font-weight: 600;
    color: #333;
}

.stamp {
    position: absolute;
    bottom: -10px;
    right: -20px;
    width: 90px;
    height: 90px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Ccircle cx='45' cy='45' r='40' fill='rgba(68, 129, 235, 0.05)' stroke='%234481eb' stroke-width='1.5' stroke-opacity='0.6' stroke-dasharray='3,2' /%3E%3Ccircle cx='45' cy='45' r='35' fill='none' stroke='%234481eb' stroke-width='0.8' stroke-opacity='0.4' /%3E%3Ctext x='45' y='35' font-family='Arial' font-size='9' font-weight='bold' fill='%234481eb' fill-opacity='0.7' text-anchor='middle'%3ESOFTONIC%3C/text%3E%3Ctext x='45' y='47' font-family='Arial' font-size='9' font-weight='bold' fill='%234481eb' fill-opacity='0.7' text-anchor='middle'%3EINSTITUTE%3C/text%3E%3Ctext x='45' y='59' font-family='Arial' font-size='8' font-weight='bold' fill='%234481eb' fill-opacity='0.7' text-anchor='middle'%3EMOHALI%3C/text%3E%3Cpath d='M25,70 Q45,75 65,70' fill='none' stroke='%234481eb' stroke-width='0.8' stroke-opacity='0.6' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transform: rotate(-15deg);
    opacity: 0.9;
}

/* Enhanced Responsive styles */
@media (max-width: 768px) {
    .certificate-container {
        padding: 5px;
    }
    
    .certificate {
        padding: 30px 20px;
        border-width: 10px;
        box-shadow: 
            0 10px 20px rgba(0, 0, 0, 0.2),
            0 -5px 15px rgba(58, 112, 209, 0.15),
            0 0 0 3px rgba(58, 112, 209, 0.1);
    }
    
    .certificate::after {
        height: 5px;
    }
    
    .certificate-emblem {
        width: 60px;
        height: 60px;
    }
    
    .certificate-emblem::before {
        width: 50px;
        height: 50px;
    }
    
    .certificate-emblem::after {
        font-size: 30px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header h1::before,
    .header h1::after {
        content: none;
    }
    
    .header h2 {
        font-size: 1.2rem;
    }
    
    .header h2::before,
    .header h2::after {
        width: 20px;
    }
    
    .header h2::before {
        left: -20px;
    }
    
    .header h2::after {
        right: -20px;
    }
    
    .student-photo {
        width: 120px;
        height: 150px;
    }
    
    .photo-container::before {
        width: 140px;
        height: 170px;
    }
    
    .footer {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .signature {
        width: 200px;
    }
    
    .certificate-watermark {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .certificate {
        padding: 20px 15px;
        border-width: 7px;
        box-shadow: 
            0 8px 15px rgba(0, 0, 0, 0.2),
            0 -3px 10px rgba(58, 112, 209, 0.15),
            0 0 0 2px rgba(58, 112, 209, 0.1);
    }
    
    .certificate::after {
        height: 4px;
    }
    
    table, tr, td {
        display: block;
    }
    
    tr {
        margin-bottom: 15px;
        border-bottom: 1px solid #eaeaea;
        padding-bottom: 10px;
    }
    
    tr:hover {
        transform: none;
    }
    
    td {
        width: 100%;
        padding: 5px 0;
    }
    
    .label {
        font-weight: 600;
        color: #444;
        width: 100%;
        background-color: transparent;
        border-right: none;
        padding-left: 5px;
    }
    
    .label::after {
        content: ':';
        position: static;
        margin-left: 5px;
    }
    
    .value {
        width: 100%;
        padding-left: 10px;
    }
    
    .certificate-ribbon span {
        font-size: 0.8rem;
        padding: 4px 15px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
    }
    
    .certificate-container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .certificate {
        border: none;
        box-shadow: none;
        padding: 20px;
        border-radius: 0;
        page-break-inside: avoid;
    }
    
    table {
        box-shadow: none;
    }
    
    tr:hover {
        transform: none;
        background-color: transparent;
    }
    
    .student-photo {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .certificate-emblem,
    .certificate-watermark,
    .stamp {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .certificate::after {
        display: none;
    }
} 