/* Certificate & Login CSS */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #F72C5B;
    --secondary-color: #F72C5B;
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --box-shadow: 0 8px 20px rgba(247, 44, 91, 0.2);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--white) 0%, #ffebf0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px 0;
}

.certificate-section {
    width: 100%;
    padding: 50px 0;
}

.certificate-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 2.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    animation: fadeInDown 1s ease-out;
}

.certificate-subtitle {
    color: var(--secondary-color);
    font-size: 2rem;
    margin-bottom: 25px;
    animation: pulse 2s infinite ease-in-out;
}

.verification-form {
    background-color: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--box-shadow);
    animation: fadeIn 1s ease-out;
    margin-bottom: 20px;
}

.form-label {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.reg-input {
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.reg-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(247, 44, 91, 0.25);
}

.verify-btn {
    background-color: var(--secondary-color);
    border: none;
    color: var(--white);
    font-weight: 600;
    padding: 12px 25px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(247, 44, 91, 0.1);
    width: 100%;
    max-width: 200px;
}

.verify-btn:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(247, 44, 91, 0.2);
}

.verify-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(247, 44, 91, 0.1);
}

.certificate-card {
    background-color: var(--white);
    border: none;
    border-radius: 15px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    animation: slideInUp 0.7s ease-out;
}

.certificate-card .card-body {
    padding: 30px;
}

.certificate-card h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.certificate-card h5 {
    color: var(--secondary-color);
    font-weight: 600;
}

.certificate-card p {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #555;
}

.certificate-card strong {
    color: var(--primary-color);
}

#studentImage {
    border: 3px solid var(--secondary-color);
    padding: 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#studentImage:hover {
    transform: scale(1.05);
}

#certificateImage {
    border: 1px solid #eee;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    margin: 15px 0;
}

#certificateImage:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

#printButton {
    background-color: #F72C5B;
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#printButton:hover {
    background-color: #e01c4a;
    transform: translateY(-2px);
}

#errorAlert {
    animation: shake 0.5s ease-in-out;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .certificate-title {
        font-size: 2rem;
    }
    
    .certificate-subtitle {
        font-size: 1.5rem;
    }
    
    .verification-form {
        padding: 20px;
    }
    
    .reg-input, .verify-btn {
        font-size: 0.95rem;
    }
    
    .certificate-card .card-body {
        padding: 20px;
    }
    
    #certificateImage {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 576px) {
    .certificate-title {
        font-size: 1.8rem;
    }
    
    .verification-form {
        padding: 15px;
    }
    
    #studentImage {
        width: 100px;
    }
    
    .certificate-card h4 {
        font-size: 1.3rem;
    }
    
    .certificate-card h5 {
        font-size: 1.1rem;
    }
    
    .certificate-card p {
        font-size: 0.9rem;
    }
}

/* Structured Certificate Display Section */
#certificateDisplay {
    background: linear-gradient(to bottom right, #ffffff, #fff0f3);
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(247, 44, 91, 0.15);
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
    animation: fadeIn 0.8s ease-out;
}

#certificateDisplay:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(247, 44, 91, 0.25);
}

#certificateDisplay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, #F72C5B, #F72C5B);
}

#certificateDisplay .card-body {
    padding: 35px 25px;
}

/* Title styling with theme colors */
#certificateDisplay h4 {
    color: #F72C5B;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
}

#certificateDisplay h4::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: #F72C5B;
    border-radius: 2px;
}

/* Student image styling */
#studentImage {
    border: 4px solid #F72C5B;
    padding: 3px;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-radius: 10px;
    margin: 25px auto;
    display: block;
    width: 140px;
    height: auto;
}

#studentImage:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(247, 44, 91, 0.3);
}

/* Student details styling - Improved alignment */
.certificate-card h5 {
    font-size: 1.2rem;
    margin: 15px 0;
    color: #F72C5B;
    text-align: center;
}

/* Student details verification section - Perfect alignment */
.student-details-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.student-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(247, 44, 91, 0.1);
    align-items: center;
}

.student-detail-label {
    color: #F72C5B;
    font-weight: 600;
    flex: 0 0 40%;
    text-align: right;
    padding-right: 20px;
}

.student-detail-value {
    color: #333;
    font-weight: 500;
    flex: 0 0 60%;
    text-align: left;
}

/* Removing the old styling that might interfere */
.certificate-card p {
    margin-bottom: 0;
    font-size: 1.05rem;
    color: #444;
}

.certificate-card strong {
    color: #F72C5B;
}

/* Certificate heading (H2 style) */
.certificate-card h5.mt-3 {
    color: #F72C5B;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-top: 30px !important;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
    position: relative;
}

.certificate-card h5.mt-3::before,
.certificate-card h5.mt-3::after {
    content: '';
    position: absolute;
    top: 50%;
    height: 2px;
    width: 60px;
    background: #F72C5B;
    opacity: 0.7;
}

.certificate-card h5.mt-3::before {
    left: 20%;
}

.certificate-card h5.mt-3::after {
    right: 20%;
}

/* Certificate image styling */
#certificateImage {
    border: 1px solid #e0e0e0;
    transition: all 0.4s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    margin: 25px auto;
    border-radius: 10px;
    max-width: 90%;
    display: block;
}

#certificateImage:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 25px rgba(247, 44, 91, 0.2);
}

/* Print button styling */
#printButton {
    background: linear-gradient(to right, #F72C5B, #e01c4a);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(247, 44, 91, 0.3);
    margin: 20px auto 10px;
    display: block;
    position: relative;
    overflow: hidden;
}

#printButton:hover {
    background: linear-gradient(to right, #e01c4a, #c91941);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(247, 44, 91, 0.4);
}

#printButton:active {
    transform: translateY(0);
}

#printButton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transition: all 0.6s ease;
}

#printButton:hover::before {
    left: 100%;
}

/* Animations for a staggered entrance effect */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#certificateDisplay h4 { animation: fadeInUp 0.5s ease-out forwards; }
#studentImage { animation: fadeInUp 0.7s ease-out forwards; }
#certificateDisplay h5:not(.mt-3) { animation: fadeInUp 0.8s ease-out forwards; }
.student-detail-row:nth-of-type(1) { animation: fadeInUp 0.9s ease-out forwards; }
.student-detail-row:nth-of-type(2) { animation: fadeInUp 1.0s ease-out forwards; }
.student-detail-row:nth-of-type(3) { animation: fadeInUp 1.1s ease-out forwards; }
.student-detail-row:nth-of-type(4) { animation: fadeInUp 1.2s ease-out forwards; }
.student-detail-row:nth-of-type(5) { animation: fadeInUp 1.3s ease-out forwards; }
.certificate-card h5.mt-3 { animation: fadeInUp 1.4s ease-out forwards; }
#certificateImage { animation: fadeInUp 1.5s ease-out forwards; }
#printButton { animation: fadeInUp 1.6s ease-out forwards; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .student-detail-row {
        flex-direction: column;
        text-align: center;
        padding: 10px 0;
    }
    
    .student-detail-label {
        flex: 0 0 100%;
        text-align: center;
        padding-right: 0;
        margin-bottom: 5px;
    }
    
    .student-detail-value {
        flex: 0 0 100%;
        text-align: center;
    }
    
    #certificateDisplay h4 {
        font-size: 1.5rem;
    }
    
    .certificate-card h5.mt-3::before,
    .certificate-card h5.mt-3::after {
        width: 40px;
    }
    
    .certificate-card h5.mt-3::before {
        left: 15%;
    }
    
    .certificate-card h5.mt-3::after {
        right: 15%;
    }
}

/* Making the download button more appealing */
#downloadButton {
    padding: 8px 20px;
    border-radius: 50px;
    background-color: #F72C5B;
    border: none;
    transition: all 0.3s ease;
}

#downloadButton:hover {
    background-color: #e01c4a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}