/* Main Layout Container - Side by Side */
.main-cert-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Certificate Image Card Styles */
.cert-image-card {
    position: relative;
    min-height: 420px !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.cert-image-card:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.cert-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;
    height: 240px;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cert-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    pointer-events: none;
    user-select: none;
    background: white;
}

/* Credly Badge Styles */
.credly-badge-card {
    position: relative;
    min-height: 420px !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    background: rgba(255, 255, 255, 0.12) !important;
    padding-bottom: 1.5rem !important;
}

.credly-badge-card:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.credly-badge-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 260px;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

/* Badge card text styling */
.credly-badge-card h3 {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.credly-badge-card p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.credly-badge-card a {
    color: #c084fc !important;
    font-weight: 600 !important;
}

/* Ensure Credly iframe displays properly */
.credly-badge-wrapper div[data-share-badge-id] {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.credly-badge-wrapper iframe {
    margin: 0 auto;
    border: none;
    max-width: 100%;
}

/* Badge card animations */
.cert-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    padding: 1.25rem;
    min-height: 420px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.5rem;
}

.cert-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Ensure text is visible in cards */
.cert-card h3 {
    color: #ffffff;
    font-weight: 700;
}

.cert-card p {
    color: rgba(255, 255, 255, 0.9);
}

.cert-card a {
    /* Color is set inline in dataLoader.js - using amber for call-to-action */
    font-weight: 600;
}

/* Certificate and Badge Grid Styling */
.certificates-grid,
.badges-grid {
    display: grid;
    gap: 1rem;
}

/* Desktop and Tablet: 2 columns in each section */
@media (min-width: 641px) {
    .certificates-grid,
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: Single column */
@media (max-width: 640px) {
    .certificates-grid,
    .badges-grid {
        grid-template-columns: 1fr;
    }
}

/* Section containers for half-screen layout */
.certificates-section,
.badges-section {
    display: flex;
    flex-direction: column;
}

/* Certificate Icon Styling */
.cert-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cert-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Ensure badges without Credly IDs show properly */
.badges-grid .cert-card {
    display: flex !important;
    flex-direction: column;
    align-items: center;
}

.badges-grid .cert-card .cert-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

/* Section Subheaders - Match Main Header Style */
.section-subheader {
    font-size: 2.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-align: center !important;
    letter-spacing: -0.025em;
    line-height: 1.2;
    transition: all 0.3s ease;
    cursor: default;
    display: block;
    width: 100%;
}

/* Gradient text effect for subheaders */
.section-subheader.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 10px rgba(102, 126, 234, 0.3));
}

/* Hover effect for section subheaders */
.section-subheader.gradient-text:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 20px rgba(102, 126, 234, 0.5));
    transform: scale(1.05);
}

/* Two Column Layout Headers */
.text-center h3 {
    text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* Tablet adjustments - Stack main sections vertically */
@media (max-width: 1024px) {
    .main-cert-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .credly-badge-wrapper {
        min-height: 230px;
    }
    
    .credly-badge-card {
        min-height: 340px;
    }
    
    .cert-card {
        padding: 0.875rem;
    }
    
    .cert-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .credly-badge-wrapper div[data-share-badge-id] {
        transform: scale(0.9);
    }
    
    .section-subheader {
        font-size: 1.875rem;
    }
}

@media (max-width: 480px) {
    .credly-badge-wrapper div[data-share-badge-id] {
        transform: scale(0.85);
    }
    
    .cert-card {
        padding: 0.75rem;
    }
    
    .section-subheader {
        font-size: 1.5rem;
    }
}
