/* Custom Styles for Md Shakawat Hossain Portfolio */
* {
    box-sizing: border-box;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    margin-bottom: 0;
    padding-bottom: 0;
}

#contact {
    margin-bottom: 0 !important;
}

footer {
    margin-top: 0;
}

/* Ensure no extra space at the bottom of main */
main> :last-child {
    margin-bottom: 0;
}

/* Custom scrollbar for quotes */
.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.custom-scroll::-webkit-scrollbar {
    width: 3px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Gradient Card Effect */
.gradient-card {
    background: linear-gradient(145deg, #ffffff 0%, #f9fafc 100%);
}

/* Project Card Hover Effect */
.project-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -10px rgba(0, 20, 50, 0.15);
}

/* Navigation Link Underline Animation */
.nav-link {
    position: relative;
}

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

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

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

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alpine.js Cloak */
[x-cloak] {
    display: none !important;
}

/* Active Tab Style */
.tab-active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Mobile Menu Animation */
.mobile-menu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Focus Styles for Accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Responsive Typography Adjustments */
@media (max-width: 640px) {
    .scroll-mt-20 {
        scroll-margin-top: 70px;
    }
}

/* Card Content Wrapping */
.project-card p,
.skill-card p {
    word-break: break-word;
}

/* Smooth Transition for All Interactive Elements */
a,
button,
.project-card,
.gradient-card {
    transition: all 0.2s ease;
}

/* Mobile Optimizations */
@media (max-width: 768px) {

    /* Improve touch targets */
    a,
    button {
        min-height: 44px;
    }

    /* Better spacing for mobile */
    .container-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid-cols-2-tablet {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Print Styles */
@media print {

    .sticky,
    header,
    footer,
    .menu-toggle,
    .mobile-menu {
        display: none !important;
    }

    body {
        background: white;
    }

    .project-card,
    .gradient-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}