/* ==========================================================================
   Certificates Page Stylesheet - American Enterprises Pvt. Ltd.
   ========================================================================== */

:root {
    --cert-primary: #2468a6;
    --cert-primary-dark: #1b4f80;
    --cert-primary-light: #eef5fc;
    --cert-dark: #161616;
    --cert-secondary: #6c757d;
    --cert-card-border: rgba(36, 104, 166, 0.14);
    --cert-shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.05);
    --cert-shadow-hover: 0 20px 40px rgba(36, 104, 166, 0.18);
}

/* Badge Pill */
.cert-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--cert-primary-light);
    color: var(--cert-primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 50px;
    border: 1px solid rgba(36, 104, 166, 0.2);
}

/* Floating Stats Bar */
.cert-stats-wrap {
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.cert-stat-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--cert-card-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    height: 100%;
}

.cert-stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(36, 104, 166, 0.12);
}

.cert-stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--cert-primary-light);
    color: var(--cert-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.cert-stat-icon i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Fallback in case fa-shield-check is used (not present in FA5 Free) */
.cert-stat-icon .fa-shield-check::before {
    content: "\f52f" !important;
    font-family: "bootstrap-icons" !important;
    font-style: normal;
    font-weight: normal !important;
}

/* Certificate Card */
.cert-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                border-color 0.3s ease;
    box-shadow: var(--cert-shadow-sm);
    position: relative;
}

.cert-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--cert-shadow-hover);
    border-color: rgba(36, 104, 166, 0.35);
}

/* Certificate Image Container */
.cert-img-wrapper {
    position: relative;
    height: 420px;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Certificate Image with Blur Effect on Hover */
.cert-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    filter: blur(0px) brightness(1);
    transform: scale(1);
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Hover -> Image blurs and zooms slightly */
.cert-card:hover .cert-img {
    filter: blur(3.5px) brightness(0.85);
    transform: scale(1.04);
}

/* Hover Overlay */
.cert-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    z-index: 3;
}

.cert-card:hover .cert-overlay {
    opacity: 1;
    visibility: visible;
}

/* View Certificate Button inside Overlay */
.cert-overlay-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--cert-primary);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    padding: 13px 28px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    transform: translateY(18px);
    transition: transform 0.35s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.cert-card:hover .cert-overlay-btn {
    transform: translateY(0);
}

.cert-overlay-btn:hover {
    background: var(--cert-primary-dark);
    box-shadow: 0 12px 30px rgba(36, 104, 166, 0.45);
}

.cert-overlay-hint {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transform: translateY(15px);
    transition: transform 0.35s ease 0.05s;
}

.cert-card:hover .cert-overlay-hint {
    transform: translateY(0);
}

/* Card Body */
.cert-card-body {
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #ffffff;
}

.cert-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 30px;
    background: #e8f5e9;
    color: #2e7d32;
    margin-bottom: 12px;
}

.cert-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cert-dark);
    margin-bottom: 6px;
    line-height: 1.35;
}

.cert-subtitle {
    font-size: 0.88rem;
    color: var(--cert-secondary);
    margin-bottom: 16px;
}

/* Certificate Meta Info List */
.cert-meta-list {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #eef2f6;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.cert-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.cert-meta-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cert-meta-label {
    color: #64748b;
    font-weight: 500;
}

.cert-meta-value {
    color: #1e293b;
    font-weight: 700;
}

/* Action Buttons in Card Footer */
.cert-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-cert-view {
    flex: 1;
    background: var(--cert-primary);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.btn-cert-view:hover {
    background: var(--cert-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(36, 104, 166, 0.25);
}

.btn-cert-pdf {
    background: #ffffff;
    color: #dc3545 !important;
    border: 1.5px solid #dc3545;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-cert-pdf:hover {
    background: #dc3545;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

/* Modal Customization */
.cert-modal .modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.cert-modal .modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #edf2f7;
    padding: 18px 24px;
}

.cert-modal .modal-body {
    background: #0f172a;
    padding: 30px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 480px;
}

.cert-modal-img {
    max-height: 75vh;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    background: #ffffff;
}

.cert-modal .modal-footer {
    background: #f8fafc;
    border-top: 1px solid #edf2f7;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* Verification Banner */
.cert-verify-box {
    background: linear-gradient(135deg, #162438 0%, #0d1726 100%);
    border-radius: 20px;
    padding: 45px 40px;
    color: #ffffff;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cert-verify-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(36, 104, 166, 0.25);
    border: 2px solid rgba(36, 104, 166, 0.5);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .cert-img-wrapper {
        height: 360px;
    }
}

@media (max-width: 767.98px) {
    .cert-img-wrapper {
        height: 320px;
    }
    .cert-stats-wrap {
        margin-top: -25px;
    }
    .cert-verify-box {
        padding: 30px 20px;
    }
}
