/* Certification Page Styles */

.certification-section {
    padding: 100px 40px;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 50%, #f0f8ff 100%);
    min-height: 100vh;
    position: relative;
}

/* Header */
.cert-header {
    text-align: center;
    margin-bottom: 60px;
}

.cert-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a2332;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.cert-title .highlight {
    background: linear-gradient(135deg, #00BFFF, #0066CC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cert-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #00BFFF, #0066CC);
    border-radius: 2px;
}

.cert-subtitle {
    font-size: 1.1rem;
    color: #5a6c7d;
    margin-top: 1.5rem;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
}

.tab-btn {
    padding: 15px 40px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    color: #5a6c7d;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab-btn i {
    font-size: 1.2rem;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.15);
    border-color: #00BFFF;
}

.tab-btn.active {
    background: linear-gradient(135deg, #00BFFF, #0066CC);
    color: white;
    border-color: transparent;
}

/* Category Sections */
.cert-category {
    display: none;
    animation: fadeIn 0.5s ease;
}

.cert-category.active {
    display: block;
}

/* Certificate Grid */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Simple Certificate Card */
.cert-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.cert-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    backface-visibility: hidden;
}

.cert-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 102, 204, 0.15);
}

.cert-card:hover img {
    transform: scale(1.05);
}

/* 카드 클릭 시 뒤집히는 애니메이션 */
.cert-card.flipping {
    transform: translateY(-8px) rotateY(180deg);
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.cert-card.flipping-back {
    transform: translateY(0) rotateY(0deg);
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

/* Hover Overlay */
.cert-card::before {
    content: '\f00e';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    background: rgba(0, 102, 204, 0.9);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1;
}

.cert-card:hover::before {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    margin: 50px auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
}

.close:hover {
    color: #00BFFF;
    transform: rotate(90deg);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animation */
.cert-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.cert-card:nth-child(1) { animation-delay: 0.1s; }
.cert-card:nth-child(2) { animation-delay: 0.15s; }
.cert-card:nth-child(3) { animation-delay: 0.2s; }
.cert-card:nth-child(4) { animation-delay: 0.25s; }
.cert-card:nth-child(5) { animation-delay: 0.3s; }
.cert-card:nth-child(6) { animation-delay: 0.35s; }
.cert-card:nth-child(7) { animation-delay: 0.4s; }
.cert-card:nth-child(8) { animation-delay: 0.45s; }
.cert-card:nth-child(9) { animation-delay: 0.5s; }
.cert-card:nth-child(10) { animation-delay: 0.55s; }
.cert-card:nth-child(11) { animation-delay: 0.6s; }
.cert-card:nth-child(12) { animation-delay: 0.65s; }
.cert-card:nth-child(13) { animation-delay: 0.7s; }

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

/* Responsive Design */
@media (max-width: 1200px) {
    .cert-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .cert-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .certification-section {
        padding: 60px 0;
    }
    
    .cert-title {
        font-size: 2rem;
    }
    
    .category-tabs {
        flex-direction: column;
        width: 100%;
        gap: 15px;
        padding: 0 20px;
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cert-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 10px;
    }
    
    .cert-card {
        height: 250px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 70vh;
    }
    
    .close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .cert-title {
        font-size: 1.6rem;
    }
    
    .cert-subtitle {
        font-size: 1rem;
    }
    
    .cert-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cert-card {
        height: 220px;
    }
    
    .tab-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .cert-card {
        page-break-inside: avoid;
        height: auto;
    }
    
    .category-tabs,
    .chatbot-button,
    .quick-menu {
        display: none;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Badge on card for important items */
.cert-card[data-title*="대통령"]::after,
.cert-card[data-title*="NET"]::after,
.cert-card[data-title*="녹색기술"]::after {
    content: '★';
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
}
