/* Specialized CSS for Certificates Showcase */

:root {
    --cs50-brand: #a51c30;
    --cs50-glow: rgba(165, 28, 48, 0.5);
    --neo4j-brand: #008cc1;
    --neo4j-glow: rgba(0, 140, 193, 0.5);
    --gcp-brand: #4285f4;
    --gcp-glow: rgba(66, 133, 244, 0.5);
    --cognitive-brand: #0f62fe;
    --cognitive-glow: rgba(15, 98, 254, 0.5);
    --hackerrank-brand: #2ec866;
    --hackerrank-glow: rgba(46, 200, 102, 0.5);
    --prodigy-brand: #3b82f6;
    --prodigy-glow: rgba(59, 130, 246, 0.5);
    --default-glow: rgba(0, 240, 255, 0.3);
}

/* Control Bar (Search & Filter) */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    width: 100%;
}

@media (min-width: 768px) {
    .controls-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* Search Bar */
.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 450px;
}

.search-input {
    width: 100%;
    padding: 0.9rem 1.2rem 0.9rem 3rem;
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
    background: rgba(15, 17, 26, 0.8);
}

.search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
    transition: fill 0.3s ease;
    pointer-events: none;
}

.search-input:focus + .search-icon {
    fill: var(--accent-1);
}

/* Filter Tags */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(45deg, var(--accent-2), var(--accent-1));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

/* Certificates Grid */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    min-height: 200px;
}

/* Card Tilt and Glow Design */
.cert-card {
    height: 100%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                border-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-style: preserve-3d;
    will-change: transform;
}

.cert-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Image Container */
.cert-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1.6 / 1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cert-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cert-card:hover .cert-thumbnail {
    transform: scale(1.05) rotate(0.5deg);
}

.cert-overlay-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(6, 7, 13, 0.9) 100%);
    opacity: 0.8;
    z-index: 1;
}

/* Dynamic Brand Badges on Cards */
.cert-badge {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Issuer Specific Accent Glows */
.cert-card.brand-cs50 {
    --accent-glow-color: var(--cs50-glow);
    --accent-border-color: var(--cs50-brand);
}

.cert-card.brand-neo4j {
    --accent-glow-color: var(--neo4j-glow);
    --accent-border-color: var(--neo4j-brand);
}

.cert-card.brand-gcp {
    --accent-glow-color: var(--gcp-glow);
    --accent-border-color: var(--gcp-brand);
}

.cert-card.brand-cognitive {
    --accent-glow-color: var(--cognitive-glow);
    --accent-border-color: var(--cognitive-brand);
}

.cert-card.brand-hackerrank {
    --accent-glow-color: var(--hackerrank-glow);
    --accent-border-color: var(--hackerrank-brand);
}

.cert-card.brand-prodigy {
    --accent-glow-color: var(--prodigy-glow);
    --accent-border-color: var(--prodigy-brand);
}

.cert-card {
    --accent-glow-color: var(--default-glow);
    --accent-border-color: var(--accent-1);
}

.cert-card:hover {
    border-color: var(--accent-border-color);
    box-shadow: 0 12px 40px -5px rgba(0, 0, 0, 0.5), 
                0 0 25px 0 var(--accent-glow-color);
}

/* Badge colors */
.brand-cs50 .cert-badge { background: var(--cs50-brand); }
.brand-neo4j .cert-badge { background: var(--neo4j-brand); }
.brand-gcp .cert-badge { background: var(--gcp-brand); }
.brand-cognitive .cert-badge { background: var(--cognitive-brand); }
.brand-hackerrank .cert-badge { background: var(--hackerrank-brand); }
.brand-prodigy .cert-badge { background: var(--prodigy-brand); }

/* Card Content details */
.cert-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.cert-issuer {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--accent-1);
    margin-bottom: 0.4rem;
}

.brand-cs50 .cert-issuer { color: #ff5577; }
.brand-neo4j .cert-issuer { color: #55ccff; }
.brand-gcp .cert-issuer { color: #ffdd66; }
.brand-cognitive .cert-issuer { color: #6ea0ff; }
.brand-hackerrank .cert-issuer { color: #2ec866; }
.brand-prodigy .cert-issuer { color: #3b82f6; }

.cert-card h3 {
    font-size: 1.25rem;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.cert-card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.cert-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 1rem;
}

.cert-skills span {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
}

/* Dynamic Entrance Animations */
.certs-grid > .hidden-scroll {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    transition: opacity 0.6s cubic-bezier(0.215, 0.61, 0.355, 1), 
                transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.certs-grid > .hidden-scroll.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Lightbox Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 4, 8, 0.85);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Box Container */
.modal-container {
    background: rgba(10, 12, 20, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    box-shadow: 0 25px 60px -10px rgba(0,0,0,0.8), 0 0 40px rgba(0, 240, 255, 0.1);
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    color: #fff;
    background: rgba(255, 0, 80, 0.2);
    border-color: rgba(255, 0, 80, 0.4);
    transform: rotate(90deg);
}

.modal-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 2rem 2.5rem;
}

@media (min-width: 768px) {
    .modal-content-grid {
        grid-template-columns: 1.2fr 1fr;
        padding: 4rem 3rem 3rem;
    }
}

/* Modal Visual Preview Side */
.modal-visual-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-image-wrap {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #030408;
    aspect-ratio: 1.414 / 1; /* Standard certificate aspect ratio */
}

.modal-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Modal Info Side details */
.modal-info-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.modal-info-header {
    margin-bottom: 1.5rem;
}

.modal-info-issuer {
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--accent-1);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.modal-info-side h2 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.modal-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-meta-item strong {
    color: var(--text-main);
}

.modal-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}

.modal-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.modal-skills-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-family: 'Fira Code', monospace;
}

.modal-skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.modal-skills-list span {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.15);
    color: var(--accent-1);
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'Fira Code', monospace;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.modal-actions .btn {
    flex: 1;
    min-width: 160px;
    justify-content: center;
}

.modal-actions .modal-verify-btn {
    width: auto;
}

/* Empty search states styling */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    fill: rgba(255,255,255,0.05);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Card On-Hold Ribbon/Overlay */
.cert-on-hold-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 7, 13, 0.65);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
    pointer-events: none;
}

.cert-on-hold-overlay span {
    background: linear-gradient(45deg, #f39c12, #f1c40f);
    color: #06070d;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(-3deg);
    font-family: 'Fira Code', monospace;
    text-transform: uppercase;
}
