/* Custom styles for scientific profile website */

body {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #1f2937;
    color: #f3f4f6;
}

body.dark-mode .bg-white {
    background-color: #111827 !important;
}

body.dark-mode .bg-gray-100 {
    background-color: #1f2937 !important;
}

body.dark-mode .bg-gray-50 {
    background-color: #374151 !important;
}

body.dark-mode .bg-gray-200 {
    background-color: #4b5563 !important;
}

body.dark-mode .text-gray-800 {
    color: #f3f4f6 !important;
}

body.dark-mode .text-gray-700 {
    color: #d1d5db !important;
}

body.dark-mode .text-gray-600 {
    color: #9ca3af !important;
}

body.dark-mode .border-gray-200,
body.dark-mode .border-blue-500 {
    border-color: #4b5563 !important;
}

body.dark-mode .shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

body.dark-mode .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
}

/* Sticky navigation container */
.sticky-nav-wrapper {
    position: sticky;
    top: 0;
    z-index: 50;
    background: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: -2rem -2rem 2rem -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    transition: background-color 0.3s ease;
}

body.dark-mode .sticky-nav-wrapper {
    background: #111827;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Tab button styles */
.tab-button {
    transition: all 0.3s ease;
}

.tab-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Tab content styles */
.tab-content {
    animation: fadeIn 0.4s ease-in-out;
}

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

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
    z-index: 100;
}

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

.back-to-top:hover {
    background: #2563eb;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.back-to-top svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Card hover effects */
.hover\:scale-105:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.hover\:shadow-lg:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Link styles */
a {
    transition: color 0.2s ease;
}

/* Section spacing */
section {
    scroll-margin-top: 2rem;
}

/* Image styles */
img {
    max-width: 100%;
    height: auto;
}

/* Smooth transitions for all elements */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Responsive adjustments for tablets */
@media (max-width: 1024px) {
    .tab-button {
        font-size: 0.875rem;
        padding: 0.5rem 0.875rem;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Better tap targets for mobile */
    .tab-button {
        font-size: 0.8rem;
        padding: 0.625rem 0.875rem;
        margin: 0.25rem;
        min-height: 44px; /* iOS recommended minimum */
    }

    /* Mobile-friendly back to top button */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }

    /* Adjust sticky nav for mobile */
    .sticky-nav-wrapper {
        margin: -2rem -1rem 1rem -1rem;
        padding: 0.75rem 0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Mobile navigation: better wrapping */
    nav[role="tablist"] {
        gap: 0.25rem;
        row-gap: 0.5rem;
    }

    /* Reduce card padding on mobile */
    .p-6 {
        padding: 1rem !important;
    }

    .p-4 {
        padding: 0.875rem !important;
    }

    /* Better image sizing on mobile */
    img.rounded-full {
        width: 5rem !important;
        height: 5rem !important;
    }

    /* Optimize text sizes for mobile */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
    }

    /* Better spacing for mobile */
    .space-y-4 > * + * {
        margin-top: 0.75rem !important;
    }

    /* Grid adjustments for mobile */
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    /* Even smaller tabs for small phones */
    .tab-button {
        font-size: 0.75rem;
        padding: 0.5rem 0.625rem;
    }

    /* Compact header on small screens */
    body {
        padding: 0.5rem !important;
    }

    .bg-white {
        padding: 1rem !important;
    }

    /* Smaller profile photo */
    img.rounded-full {
        width: 4rem !important;
        height: 4rem !important;
    }

    /* Reduce heading sizes further */
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    /* Smaller back to top button */
    .back-to-top {
        width: 2.5rem;
        height: 2.5rem;
        bottom: 0.75rem;
        right: 0.75rem;
    }

    .back-to-top svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sticky-nav-wrapper {
        padding: 0.5rem;
    }

    .tab-button {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .tab-button:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* Larger tap targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better active states for touch */
    .tab-button:active {
        transform: scale(0.98);
    }

    .back-to-top:active {
        transform: scale(0.95);
    }
}
