/* ---------- Global & Dark Mode ---------- */
html {
    scroll-behavior: smooth;
}

:root {
    --bg: #f8fafc; /* gray-50 */
    --card: #ffffff;
    --text: #1f2937; /* gray-800 */
    --muted: #6b7280; /* gray-500 */
    --accent: #2563eb; /* blue-600 */
}

html.dark {
    --bg: #0f172a; /* slate-900 */
    --card: #0b1220; /* darker card */
    --text: #e6eef8; /* near-white text */
    --muted: #9ca3af; /* gray-400 */
    --accent: #60a5fa; /* light blue */
}

body {
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 200ms ease, color 200ms ease;
}

html.dark body { background-color: var(--bg) !important; color: var(--text) !important; }
html.dark .bg-white { background-color: var(--card) !important; }
html.dark .text-gray-700 { color: var(--text) !important; }
html.dark .text-gray-600, html.dark .text-gray-500 { color: var(--muted) !important; }
html.dark .bg-gray-50 { background-color: var(--bg) !important; }
html.dark .border-gray-300 { border-color: rgba(255,255,255,0.06) !important; }
html.dark .bg-blue-500 { background-color: var(--accent) !important; }
html.dark .hover\:bg-blue-600:hover { background-color: #3b82f6 !important; }

/* ---------- Nav link hover effect ---------- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ---------- Project Cards ---------- */
.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ---------- Skill Bars ---------- */
.skill-bar {
    transition: width 1.5s ease;
}

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

.fade-in { animation: fadeIn 0.8s ease forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

/* ---------- Marquee Animation ---------- */
@keyframes marquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    display: inline-block;
    animation: marquee 40s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

/* ---------- Certificate Trigger ---------- */
#cert-trigger {
    max-width: 400px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
}

#cert-trigger h3 { margin-bottom: 0.5rem; font-size: 1.25rem; color: #2d3748; }
#cert-trigger p { margin-bottom: 1rem; color: #4a5568; }
#cert-trigger .view-link { color: #5a67d8; text-decoration: none; font-weight: 500; }
#cert-trigger .view-link:hover { text-decoration: underline; }

/* ---------- Certificate Container ---------- */
#cert-container {
    display: none; 
    margin: 1rem auto;
    max-width: 100%;
    overflow-x: auto; 
    padding-bottom: 1rem;
}

#cert-container .cert-row {
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap; 
}

.cert-thumb:hover {
    transform: scale(1.05);
    transition: transform 0.2s;
}

/* Responsive tweaks */
@media (max-width: 640px) {
    #cert-row .cert-thumb { width: 32%; height: auto; }
}

/* ---------- Modal ---------- */
.modal-dialog {
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
    .modal-dialog {
        max-width: 96%;
        border-radius: 0.75rem;
        padding: 1rem;
    }
}

.modal-dialog #modalContent { padding-bottom: 1rem; }

#modalCloseBtn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
}






