/* Modern Certificate Portfolio - Optimized CSS */
:root {
    --primary: #ff7e33;
    --primary-light: #ffaa5e;
    --secondary: #ff5e62;
    --dark: #2d3436;
    --light: #f8f9fa;
    --gray: #6c757d;
    --light-gray: #f5f6fa;
    --white: #fff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --footer-bg: #1a1e21;
    --text-muted: #adb5bd;
}

/* Base Reset & Typography */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
}

/* Layout Components */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 4rem 0 5rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.header-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

header h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

header p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
    font-weight: 400;
    margin-bottom: 2rem;
}

/* Main Content */
main {
    padding: 2rem 0 4rem;
}

/* Certificate Grid */
.certificate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.certificate-card {
    --card-shadow: var(--shadow);
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.certificate-card:hover {
    transform: translateY(-5px);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.certificate-img {
    position: relative;
    overflow: hidden;
    background: var(--light-gray);
    height: 200px; /* Fixed height for consistency */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.certificate-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.certificate-card:hover .certificate-img img {
    transform: scale(1.03);
}

.certificate-details {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.certificate-details h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.certificate-details p {
    color: var(--gray);
    margin: 0 0 1.25rem;
    flex-grow: 1;
    line-height: 1.5;
}

.certificate-links {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    gap: 0.5rem;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 126, 51, 0.25);
}

.btn-primary:hover {
    background: transparent;
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.date i {
    font-size: 1rem;
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--light);
    padding: 4rem 0 2rem;
    margin-top: 6rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

.footer-section {
    text-align: left;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    position: relative;
    display: inline-block;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.footer-section p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.footer-links i {
    font-size: 0.8rem;
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    margin-right: 12px;
    transition: var(--transition);
    font-size: 1rem;
    text-decoration: none !important;
    border: none;
    outline: none;
    box-shadow: none;
}

.social-links a:hover,
.social-links a:focus,
.social-links a:active {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
    text-decoration: none !important;
    box-shadow: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 2.5rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom p {
    color: var(--gray);
    font-size: 0.9rem;
    margin: 0;
}

.footer-bottom a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    text-decoration: underline;
}

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

.certificate-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

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

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--secondary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top:active {
    transform: translateY(0) scale(0.98);
}

/* Responsive Design */
@media (max-width: 768px) {
    .certificate-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .social-links {
        justify-content: center;
    }
}
