/* Planet Certificate Frontend Styles */

/* IranSans Font Face Declarations */
@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb.woff2') format('woff2'),
         url('../fonts/IRANSansWeb.woff') format('woff'),
         url('../fonts/IRANSansWeb.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Light.woff2') format('woff2'),
         url('../fonts/IRANSansWeb_Light.woff') format('woff'),
         url('../fonts/IRANSansWeb_Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Medium.woff2') format('woff2'),
         url('../fonts/IRANSansWeb_Medium.woff') format('woff'),
         url('../fonts/IRANSansWeb_Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Bold.woff2') format('woff2'),
         url('../fonts/IRANSansWeb_Bold.woff') format('woff'),
         url('../fonts/IRANSansWeb_Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Black.woff2') format('woff2'),
         url('../fonts/IRANSansWeb_Black.woff') format('woff'),
         url('../fonts/IRANSansWeb_Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

.planet-certificate-frontend-container {
    max-width: 1100px;
    font-family: 'IRANSans', "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.planet-certificate-search-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 32px;
    margin-bottom: 32px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.planet-certificate-search-form h3 {
    color: #1f2937;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.planet-certificate-search-form p {
    color: #6b7280;
    margin-bottom: 24px;
}

.planet-certificate-search-form label {
    display: block;
    margin-bottom: 16px;
    font-size: 16px;
    color: #374151;
    font-weight: 600;
}

.planet-certificate-search-form input[type="text"] {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.planet-certificate-search-form input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.planet-certificate-search-form button {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    margin-right: 10px;
}

.planet-certificate-search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Certificate Card - Background Image Design */
.planet-certificate-card {
    background-image: url('../images/Cert-BG.jpg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: none; /* Remove CSS border since using image */
    border-radius: 0;
    padding: 140px 110px 100px 110px; /* Adjust padding to fit within decorative borders */
    color: #2c3e50;
    text-align: center;
    position: relative;
    overflow: visible;
    width: 1100px;
    height: 785px; /* Fixed dimensions to match background aspect ratio */
}

/* Remove CSS-generated decorative borders since using image */
.planet-certificate-card::before,
.planet-certificate-card::after {
    display: none;
}

.planet-certificate-card .certificate-content {
    position: relative;
    z-index: 1;
    background: transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
}

/* Remove the badge styling - not needed for traditional design */
.planet-certificate-card .cert-badge {
    display: none;
}

/* Main certificate title */
.planet-certificate-card .cert-title {
    font-size: 44px;
    font-weight: 400;
    color: #4a74b8;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 6px;
    text-shadow: none;
    font-family: 'Times New Roman', 'IRANSans', serif;
}

/* Subtitle */
.planet-certificate-card .cert-awarded {
    font-size: 22px;
    color: #4a74b8;
    margin-bottom: 25px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 300;
    font-family: 'Times New Roman', 'IRANSans', serif;
}

/* "This is to certify that" text */
.planet-certificate-card .cert-desc {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-style: italic;
    font-family: 'Times New Roman', 'IRANSans', serif;
}

/* Recipient name styling */
.planet-certificate-card .cert-name {
    font-size: 36px;
    font-weight: 400;
    color: #2c3e50;
    margin-bottom: 20px;
    text-shadow: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Times New Roman', 'IRANSans', serif;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 6px;
    display: inline-block;
    min-width: 300px;
}

/* Course completion text */
.planet-certificate-card .cert-course-intro {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-family: 'Times New Roman', 'IRANSans', serif;
    line-height: 1.4;
}

/* Course name */
.planet-certificate-card .cert-course {
    font-size: 24px;
    font-weight: 400;
    color: #4a74b8;
    margin-bottom: 20px;
    text-shadow: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Times New Roman', 'IRANSans', serif;
}

/* Achievement text */
.planet-certificate-card .cert-achievement {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 30px;
    font-style: italic;
    font-family: 'Times New Roman', 'IRANSans', serif;
}

/* Remove the divider */
.planet-certificate-card .cert-divider {
    display: none;
}

/* Signature section */
.planet-certificate-card .cert-signature-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 60px;
    padding-top: 15px;
    width: 100%;
    max-width: 500px;
}

.planet-certificate-card .cert-signature-left {
    text-align: left;
    flex: 1;
}

.planet-certificate-card .cert-signature-right {
    text-align: right;
    flex: 1;
}

.planet-certificate-card .cert-signature-name {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 5px;
    font-family: 'Times New Roman', 'IRANSans', serif;
}

.planet-certificate-card .cert-signature-title {
    font-size: 14px;
    color: #6b7280;
    font-family: 'Times New Roman', 'IRANSans', serif;
}

.planet-certificate-card .cert-date {
    font-size: 16px;
    color: #2c3e50;
    font-family: 'Times New Roman', 'IRANSans', serif;
}

.planet-certificate-card .cert-date-label {
    font-size: 16px;
    color: #6390b1;
    margin-top: 5px;
    font-weight: 500;
    margin-right: 25px;
}

/* Hide the modern details grid */
.cert-details-grid {
    display: none;
}

/* QR Code - make it smaller and position it better */
.planet-certificate-card .cert-qr {
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: inline-block;
    margin: 0;
    box-shadow: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.6;
    z-index: 2;
}

.planet-certificate-card .cert-qr img {
    display: block;
    border-radius: 0;
    width: 70px;
    height: 70px;
}

/* Actions - style them to be less prominent */
.planet-certificate-card .cert-actions {
    margin-top: 30px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Download Actions - positioned completely outside certificate */
.cert-download-actions {
    margin-top: 30px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 30px auto 0;
    border: 1px solid #e5e7eb;
}

.cert-download-actions .cert-btn {
    background: #4a74b8;
    color: #fff;
    border: 2px solid #4a74b8;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Times New Roman', 'IRANSans', serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
}

.cert-download-actions .cert-btn:hover {
    background: #6b8dd6;
    border-color: #6b8dd6;
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 4px 12px rgba(74, 116, 184, 0.3);
}

.cert-download-actions .cert-btn.primary {
    background: #4a74b8;
    color: #fff;
    border-color: #4a74b8;
}

.cert-download-actions .cert-btn.primary:hover {
    background: #6b8dd6;
    border-color: #6b8dd6;
    color: #fff;
}

.cert-download-actions .cert-btn.secondary {
    background: #6b7280;
    color: #fff;
    border-color: #6b7280;
}

.cert-download-actions .cert-btn.secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
    color: #fff;
}

.cert-download-actions .cert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cert-download-actions .cert-btn:disabled:hover {
    background: #4a74b8;
    border-color: #4a74b8;
    transform: none;
    box-shadow: none;
}

/* Mobile-specific styles */
.cert-download-actions[data-device-type="mobile"] {
    flex-direction: column;
    align-items: center;
}

.cert-download-actions[data-device-type="mobile"] .cert-btn {
    width: 100%;
    max-width: 300px;
    margin: 5px 0;
}

/* Mobile users only see PDF download button */
.cert-download-actions[data-device-type="mobile"] .cert-btn.secondary {
    display: none; /* Hide any secondary buttons (image download) on mobile */
}

/* Mobile responsive certificate display */
@media screen and (max-width: 767px) {
    .planet-certificate-frontend-container {
        width: 100%;
        margin: 0 auto;
        padding: 0;
    }
    
    .planet-certificate-card {
        width: 100%;
        min-height: auto;
        padding: 20px 15px;
        margin: 0;
    }
    
    .certificate-content {
        width: 100%;
        padding: 15px;
    }
    
    
    
    .cert-desc {
        font-size: 12px !important;
        margin-bottom: 0 !important;
    }

    
    .cert-course-intro {
        font-size: 11px !important;
        margin: 10px 0;
        line-height: 1.4;
    }

    
    .cert-achievement {
        font-size: 13px !important;
        margin: 0;
        margin-bottom: 0 !important;
    }
    
    .cert-signature-section {
        margin-top: 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .cert-date {
        font-size: 14px !important;
    }
    
    .cert-date-label {
        font-size: 12px !important;
    }
    
    .cert-qr {
        margin-top: 15px;
    }
    

    
    .cert-download-actions {
        margin-top: 20px;
        padding: 15px;
        margin-bottom: 20px;
        transform: none;
    }
    
    /* Mobile search form adjustments */
    .planet-certificate-search-form {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .planet-certificate-search-form h3 {
        font-size: 20px !important;
    }
    
    .planet-certificate-search-form input[type="text"] {
        max-width: 100%;
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .planet-certificate-search-form button {
        width: 100%;
        max-width: 250px;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    /* Certificate list mobile styles */
    .cert-list-item {
        padding: 15px !important;
    }
    
    .cert-item-info h4 {
        font-size: 16px !important;
    }
    
    
    .cert-details {
        font-size: 12px !important;
    }
    
    .cert-btn {
        font-size: 14px !important;
        padding: 8px 16px !important;
        min-width: auto !important;
    }
}

/* Certificate Details Grid */
.cert-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin: 20px 0;
    font-size: 14px;
}

.cert-detail-item {
    text-align: center;
}

.cert-detail-label {
    color: rgba(255,255,255,0.8);
    margin-bottom: 4px;
}

.cert-detail-value {
    font-weight: 600;
}

/* Error and Loading States */
.planet-certificate-error {
    background: #fef2f2;
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #fecaca;
    margin: 20px 0;
}

.planet-certificate-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.planet-certificate-loading::before {
    content: "";
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {


    .planet-certificate-search-form,
    .planet-certificate-card {
        padding: 24px;
    }


    .planet-certificate-card .cert-course {
        font-size: 14px;
        margin-bottom: 0 !important;
    }

    .planet-certificate-card .cert-actions {
        flex-direction: column;
    }
}

/* Responsive design for background image */
@media (max-width: 768px) {
    .planet-certificate-card {
        width: 100%;
        height: auto;
        background-size: contain;
    }

    .planet-certificate-card .cert-title {
        font-size: 22px;
        letter-spacing: 4px;
        margin-bottom: 4px;
    }

    .planet-certificate-card .cert-awarded {
        font-size: 14px;
        margin-bottom: 0px;
    }

    .planet-certificate-card .cert-name {
        font-size: 20px;
        margin: 0 !important;
    }


    .planet-certificate-card .cert-signature-section {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        margin-top: 0;
        max-width: 100%;
        align-items: flex-start;
    }

    .planet-certificate-card .cert-signature-left,
    .planet-certificate-card .cert-signature-right {
        text-align: center;
    }



    .planet-certificate-card .cert-qr img {
        width: 40px;
        height: 40px;
    }
}

/* Certificate List Styles */
.planet-certificate-list-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'IRANSans', Arial, sans-serif;
    direction: rtl;
}

.cert-list-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.cert-list-header h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
}

.cert-list-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.cert-list {
    display: grid;
    gap: 16px;
}

.cert-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.cert-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.cert-item-info {
    flex: 1;
}

.cert-item-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
}

.cert-item-info .cert-course {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #667eea;
    font-weight: 500;
    text-align: right;
}

.cert-details {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.cert-details span {
    font-size: 14px;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
}

.cert-item-actions {
    margin-right: 20px;
}

.cert-btn.secondary {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cert-btn.secondary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

@media (max-width: 768px) {
    .cert-list-item {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .cert-item-actions {
        margin-right: 0;
        text-align: center;
    }
    
    .cert-details {
        justify-content: center;
    }
} 