/* Custom CSS for HOX Coding Website */

/* Base Animations and Effects */
@keyframes dnaSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Logo and Branding */
.dna-spin {
    animation: dnaSpin 10s linear infinite;
}

.pixel-letter {
    background: linear-gradient(135deg, #7e828a, #86838d);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* Navigation Enhancements */
.nav-sticky {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

/* Service Cards */
.service-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
}

.service-icon {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    color: #4f46e5;
}

/* Workflow Steps */
.workflow-step {
    transition: all 0.3s ease;
    opacity: 0.6;
}

.workflow-step.active {
    opacity: 1;
    transform: scale(1.05);
}

.workflow-step.active .step-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

/* Hero Section */
.hero-gradient {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
}

/* Interactive Elements */
.interactive-demo {
    position: relative;
    overflow: hidden;
}

.data-point {
    transition: all 0.5s ease;
    cursor: pointer;
}

.data-point:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

/* Button Enhancements */
.btn-primary {
    background: linear-gradient(135deg, #35c2b6, #35c2b6);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg,  #35c2b6, #35c2b6);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    border: 2px solid #35c2b6;
    color: #35c2b6;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #35c2b6;
    color: white;
    transform: translateY(-1px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .service-card {
        margin-bottom: 1rem;
    }
    
    .workflow-step {
        margin-bottom: 1rem;
    }
    
    .hero-gradient {
        padding: 2rem 0;
    }
}

/* Loading States */
.loading {
    animation: pulse 2s infinite;
}

/* Accessibility */
.focus-visible:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

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

.hero-image-section {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    height: 400px;
    margin-top: 1px; 
}

@media (min-width: 768px) {
    .hero-image-section {
        height: 500px;
    }
}

/* HOX Header Color and Scroll Effects */

/* Change header background to semi-transparent teal */
nav.bg-white.shadow-lg.sticky.top-0.z-50 {
    background-color: rgba(151, 208, 205, 0.8) !important; /* Your previous teal color */
    backdrop-filter: blur(5px) !important;
    transition: background-color 0.3s ease !important;
}

/* More transparent when scrolling */
nav.bg-white.shadow-lg.sticky.top-0.z-50.scrolled {
    background-color: rgba(151, 208, 205, 0.6) !important;
}

/* Change text colors to white for visibility on teal background */
nav a {
    color: white !important;
}

nav a:hover {
    color: #71b6b6 !important; /* Light teal hover from your previous design */
}


/* Enhanced Portfolio CSS - Scientific Animations and Styling */

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
    transform: translateY(0);
}

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

/* Scientific visualization animations */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-rotate {
    animation: rotate 4s linear infinite;
}

/* Custom bounce animation with delays */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-15px);
    }
    70% {
        transform: translateY(-7px);
    }
    90% {
        transform: translateY(-3px);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* Custom pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Portfolio section styling */
#portfolio {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Enhanced card styling */
.portfolio-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

/* Image container styling */
.portfolio-image-container {
    height: 12rem;
    position: relative;
    overflow: hidden;
}

/* Overlay styling */
.portfolio-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

/* Scientific visualization backgrounds */
.viz-bg-indigo {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.viz-bg-emerald {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.viz-bg-purple {
    background: linear-gradient(135deg, #e9d5ff 0%, #ddd6fe 100%);
}

.viz-bg-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.viz-bg-amber {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.viz-bg-green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

/* Category badge styling */
.category-badge {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    display: inline-block;
}

.category-biostatistics {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.category-molecular {
    background-color: #d1fae5;
    color: #059669;
}

.category-genomics {
    background-color: #e9d5ff;
    color: #7c3aed;
}

.category-cell-biology {
    background-color: #dbeafe;
    color: #2563eb;
}

.category-nanotechnology {
    background-color: #fef3c7;
    color: #d97706;
}

.category-physiology {
    background-color: #dcfce7;
    color: #16a34a;
}

/* Button styling */
.cta-button {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    color: white;
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .portfolio-image-container {
        height: 10rem;
    }
    
    .animate-rotate svg {
        width: 80px;
        height: 80px;
    }
    
    .animate-pulse svg {
        width: 60px;
        height: 60px;
    }
}

/* Loading animation for dynamic content */
.portfolio-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced typography */
.portfolio-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.portfolio-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 42rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* Grid enhancements */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Accessibility improvements */
.portfolio-card:focus-within {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.portfolio-overlay a:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .portfolio-overlay,
    .animate-rotate,
    .animate-pulse,
    .animate-bounce {
        display: none !important;
    }
}

/* Portfolio Preview Section Custom CSS */

/* Section background and spacing */
.portfolio-preview {
    position: relative;
    overflow: hidden;
}

/* Portfolio grid items */
.portfolio-item {
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Image container with aspect ratio */
.aspect-w-16.aspect-h-9 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}

.aspect-w-16.aspect-h-9 img {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    object-fit: cover;
}

/* Overlay styling */
.portfolio-overlay {
    background-image: linear-gradient(to top, rgba(49, 46, 129, 0.9), rgba(79, 70, 229, 0.7));
    transition: all 0.4s ease;
}

/* Text animations on hover */
.portfolio-item .transform {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Custom hover effects for each portfolio item */
.portfolio-item:nth-child(1) .portfolio-overlay {
    background-image: linear-gradient(to top, rgba(49, 46, 129, 0.9), rgba(79, 70, 229, 0.7));
}

.portfolio-item:nth-child(2) .portfolio-overlay {
    background-image: linear-gradient(to top, rgba(76, 29, 149, 0.9), rgba(124, 58, 237, 0.7));
}

.portfolio-item:nth-child(3) .portfolio-overlay {
    background-image: linear-gradient(to top, rgba(30, 58, 138, 0.9), rgba(59, 130, 246, 0.7));
}

.portfolio-item:nth-child(4) .portfolio-overlay {
    background-image: linear-gradient(to top, rgba(19, 78, 74, 0.9), rgba(20, 184, 166, 0.7));
}

/* Glow effect on hover */
.portfolio-item:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 0 25px 3px rgba(79, 70, 229, 0.4);
    opacity: 0;
    animation: glow 1.5s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -1;
}

.portfolio-item:nth-child(2):hover::after {
    box-shadow: 0 0 25px 3px rgba(124, 58, 237, 0.4);
}

.portfolio-item:nth-child(3):hover::after {
    box-shadow: 0 0 25px 3px rgba(59, 130, 246, 0.4);
}

.portfolio-item:nth-child(4):hover::after {
    box-shadow: 0 0 25px 3px rgba(20, 184, 166, 0.4);
}

@keyframes glow {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* View Full Portfolio button styling */
.portfolio-preview a.bg-indigo-600 {
    transition: all 0.3s ease;
}

.portfolio-preview a.bg-indigo-600:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .portfolio-item {
        margin-bottom: 1.5rem;
    }
    
    .portfolio-overlay {
        opacity: 0.9; /* More visible on mobile */
    }
    
    .portfolio-item .transform {
        transform: translateY(0); /* No transform on mobile */
    }
}

/* Image placeholder styling */
.portfolio-item .bg-gray-200 {
    position: relative;
    overflow: hidden;
}

.portfolio-item .bg-gray-200::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    right: -10%;
    bottom: -10%;
    background: linear-gradient(90deg, 
        rgba(226, 232, 240, 0) 0%, 
        rgba(226, 232, 240, 0.5) 50%, 
        rgba(226, 232, 240, 0) 100%);
    animation: shimmer 2s infinite;
    transform: skewX(-20deg);
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) skewX(-20deg);
    }
    100% {
        transform: translateX(200%) skewX(-20deg);
    }
}