/* ===== GLOBAL STYLES ===== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light mode styles */
html.light body {
    background: linear-gradient(to bottom right, #f8fafc, #e2e8f0) !important;
    color: #1e293b !important;
}

html.light nav {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-bottom-color: #e2e8f0 !important;
}

html.light #mobile-menu {
    background-color: #ffffff !important;
    border-left-color: #e2e8f0 !important;
}

html.light section {
    color: #1e293b !important;
}

html.light .bg-slate-800\/50,
html.light .bg-slate-900 {
    background-color: rgba(255, 255, 255, 0.9) !important;
}

html.light .text-slate-100,
html.light .text-slate-200,
html.light .text-slate-300 {
    color: #1e293b !important;
}

html.light .text-slate-400 {
    color: #64748b !important;
}

html.light .bg-slate-900,
html.light .bg-slate-800 {
    background-color: #ffffff !important;
}

/* Light mode - consistent styling */
html.light .border-slate-700 {
    border-color: #e2e8f0 !important;
}

html.light footer {
    background-color: #0f172a !important;
}

/* Skill bar transition */
.skill-bar {
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

::-webkit-scrollbar-thumb {
    background: #0284c7;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0369a1;
}

/* ===== ANIMATIONS ===== */

/* Fade-in animation on scroll */
.fade-in-element {
    opacity: 0;
    animation: fadeInScroll 0.6s ease-in-out forwards;
}

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

/* Stagger animation delay for multiple elements */
.fade-in-element:nth-child(1) { animation-delay: 0.1s; }
.fade-in-element:nth-child(2) { animation-delay: 0.2s; }
.fade-in-element:nth-child(3) { animation-delay: 0.3s; }
.fade-in-element:nth-child(4) { animation-delay: 0.4s; }
.fade-in-element:nth-child(5) { animation-delay: 0.5s; }
.fade-in-element:nth-child(6) { animation-delay: 0.6s; }

/* ===== TYPOGRAPHY ===== */

/* Smooth text rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Heading styles */
h1, h2, h3 {
    letter-spacing: -0.5px;
}

/* ===== BUTTONS ===== */

/* Button hover effects */
button:active {
    transform: scale(0.98);
}

/* ===== LINKS ===== */

/* Link focus states for accessibility */
a:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 2px;
}

/* ===== FORM ELEMENTS ===== */

/* Input and textarea focus states */
input:focus,
textarea:focus {
    outline: none;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile optimizations */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevents zoom on mobile input focus */
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

/* ===== UTILITIES ===== */

/* Smooth transition utility */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Shadow effects */
.shadow-glow {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Backdrop blur for navbar */
@supports (backdrop-filter: blur(1px)) {
    .backdrop-blur-md {
        backdrop-filter: blur(12px);
    }
}

/* Animation for experience cards on hover */
.experience-card {
    transition: all 0.3s ease;
}

.experience-card:hover {
    transform: translateY(-4px);
}

/* Project card hover effect */
.project-card {
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    nav,
    footer,
    #scroll-to-top {
        display: none;
    }
}

/* ===== CUSTOM COMPONENT STYLES ===== */

/* Focus cards hover effect */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

/* Learning resource cards */
.learning-card {
    transition: all 0.3s ease;
}

.learning-card:hover {
    transform: translateY(-4px);
}

/* Project cards image zoom on hover */
.group:hover img {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Skills/Tools grid items */
.tools-item {
    transition: all 0.3s ease;
}

.tools-item:hover {
    transform: translateY(-2px);
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    /* Reduce padding on mobile */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Stack buttons on very small screens */
    .flex-wrap {
        gap: 0.75rem;
    }
    
    /* Ensure focus area cards are fully visible */
    .apple-cards-grid {
        gap: 1.5rem;
    }
}

/* Tablet specific styles */
@media (min-width: 641px) and (max-width: 1024px) {
    /* Adjust card sizing for tablets */
    .marquee-track .cert-card {
        width: 300px;
    }
    
    .marquee-track .project-card {
        width: 360px;
    }
    
    .marquee-track .tool-card {
        width: 170px;
    }
    
    /* Ensure apple section cards have proper spacing */
    .apple-cards-grid {
        gap: 1.5rem;
    }
    
    /* Improve touch targets on tablets */
    .glass-button {
        padding: 1.25rem 1.75rem;
    }
}

/* Smooth section transitions */
section {
    transition: background-color 0.3s ease;
}

/* Light mode adjustments for new structure */
html.light .bg-slate-800\/50 {
    background-color: rgba(248, 250, 252, 0.9) !important;
}

html.light .bg-green-500\/20 {
    background-color: rgba(34, 197, 94, 0.15) !important;
}

html.light .bg-yellow-500\/20 {
    background-color: rgba(234, 179, 8, 0.15) !important;
}

html.light .bg-ocean-500\/20 {
    background-color: rgba(14, 165, 233, 0.15) !important;
}

html.light .text-green-400 {
    color: #16a34a !important;
}

html.light .text-yellow-400 {
    color: #ca8a04 !important;
}

html.light .text-ocean-400 {
    color: #0284c7 !important;
}

/* ===== APPLE-STYLE SCROLL SECTIONS ===== */
.apple-section {
    position: relative;
    will-change: transform;
}

.apple-content {
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease-out;
}

.apple-section.in-view .apple-content {
    transform: scale(1);
    opacity: 1;
}

.apple-title {
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, opacity 0.6s ease-out 0.1s;
}

.apple-section.in-view .apple-title {
    transform: translateY(0);
    opacity: 1;
}

.apple-divider {
    transform: scaleX(0);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.apple-section.in-view .apple-divider {
    transform: scaleX(1);
}

.apple-subtitle {
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s, opacity 0.6s ease-out 0.25s;
}

.apple-section.in-view .apple-subtitle {
    transform: translateY(0);
    opacity: 1;
}

.apple-card {
    transform: translateY(60px) scale(0.95);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s, opacity 0.6s ease-out 0.3s;
}

.apple-section.in-view .apple-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.apple-cards-grid > div {
    transform: translateY(60px) scale(0.9);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease-out;
}

.apple-cards-grid > div:nth-child(1) {
    transition-delay: 0.3s;
}

.apple-cards-grid > div:nth-child(2) {
    transition-delay: 0.45s;
}

.apple-section.in-view .apple-cards-grid > div {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Scroll-driven scale effect */
.apple-section {
    --scroll-scale: 0.85;
}

.apple-section.scrolling .apple-content {
    transform: scale(var(--scroll-scale));
}

/* Smooth exit animation */
.apple-section.exiting .apple-content {
    transform: scale(0.9) translateY(-30px);
    opacity: 0.7;
    transition: transform 0.5s ease-in, opacity 0.5s ease-in;
}

/* Mobile/Tablet optimizations for apple sections */
@media (max-width: 768px) {
    .apple-content {
        transform: scale(0.9);
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease-out;
    }
    
    .apple-title {
        transform: translateY(25px);
    }
    
    .apple-card {
        transform: translateY(40px) scale(0.97);
    }
    
    .apple-cards-grid > div {
        transform: translateY(40px) scale(0.95);
    }
    
    /* Reduce motion for better mobile performance */
    .apple-section.exiting .apple-content {
        transform: scale(0.95) translateY(-15px);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .apple-content {
        transform: scale(0.92);
    }
    
    .apple-section.in-view .apple-content {
        transform: scale(1);
    }
    
    /* Faster animations for touch devices */
    .apple-content,
    .apple-title,
    .apple-divider,
    .apple-subtitle,
    .apple-card,
    .apple-cards-grid > div {
        transition-duration: 0.5s;
    }
}

/* ===== ABOUT SECTION GLOW EFFECTS ===== */
.about-glow-card {
    animation: subtle-glow 3s ease-in-out infinite alternate;
}

@keyframes subtle-glow {
    0% {
        box-shadow: 0 0 20px rgba(255, 111, 97, 0.15), 0 0 40px rgba(255, 111, 97, 0.05);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 111, 97, 0.25), 0 0 60px rgba(255, 111, 97, 0.1);
    }
}

.about-glow-card:hover {
    animation: none;
}

.glow-text {
    text-shadow: 0 0 10px rgba(255, 111, 97, 0.5), 0 0 20px rgba(255, 111, 97, 0.3);
}

.about-glow-card p {
    transition: all 0.3s ease;
}

.about-glow-card:hover p {
    color: #cbd5e1;
}

/* ===== HORIZONTAL MARQUEE ANIMATION ===== */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes scroll-right {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Marquee wrapper - hide overflow */
.marquee-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

/* Marquee track - double content for seamless loop */
.marquee-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: scroll-left 30s linear infinite;
}

.marquee-track-reverse {
    animation: scroll-right 30s linear infinite;
}

/* Pause animation on hover */
.marquee-wrapper:hover .marquee-track {
    animation-play-state: paused;
}

/* Marquee items */
.marquee-track .cert-card,
.marquee-track .project-card,
.marquee-track .tool-card {
    flex-shrink: 0;
}

/* Speed variants */
.marquee-track.slow {
    animation-duration: 45s;
}

.marquee-track.fast {
    animation-duration: 20s;
}

/* Touch interaction for mobile - pause on touch */
.marquee-wrapper.touch-active .marquee-track {
    animation-play-state: paused;
}

/* Responsive card sizing for marquee items */
@media (max-width: 640px) {
    .marquee-track .cert-card {
        width: 280px;
        padding: 1rem;
    }
    
    .marquee-track .project-card {
        width: 320px;
    }
    
    .marquee-track .tool-card {
        width: 140px;
        padding: 1rem;
    }
    
    .marquee-track .tool-card .text-4xl {
        font-size: 1.75rem;
    }
    
    .marquee-track .project-card .p-8 {
        padding: 1.25rem;
    }
    
    .marquee-track .project-card h3 {
        font-size: 1.25rem;
    }
    
    .marquee-track .project-card p {
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .marquee-track .cert-card {
        width: 300px;
    }
    
    .marquee-track .project-card {
        width: 340px;
    }
    
    .marquee-track .tool-card {
        width: 160px;
    }
    
    /* Slower animation on mobile for easier reading */
    .marquee-track {
        animation-duration: 40s;
    }
    
    .marquee-track.slow {
        animation-duration: 60s;
    }
    
    .marquee-track.fast {
        animation-duration: 30s;
    }
}

/* ===== CERTIFICATIONS HORIZONTAL SCROLL ===== */
.cert-scroll-track {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 111, 97, 0.5) rgba(30, 41, 59, 0.5);
    -webkit-overflow-scrolling: touch;
}

.cert-scroll-track::-webkit-scrollbar {
    height: 8px;
}

.cert-scroll-track::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
}

.cert-scroll-track::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, rgba(255, 111, 97, 0.6), rgba(14, 165, 233, 0.6));
    border-radius: 10px;
}

.cert-scroll-track::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to right, rgba(255, 111, 97, 0.8), rgba(14, 165, 233, 0.8));
}

.cert-card {
    cursor: pointer;
}

.cert-card:active {
    cursor: grabbing;
}

/* ===== CERTIFICATE IMAGE CARD ===== */
.cert-image-card {
    padding: 0;
}

.cert-image-card .cert-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.cert-image-card {
    text-decoration: none;
    color: inherit;
}

.cert-image-card:hover {
    text-decoration: none;
}

@media (max-width: 640px) {
    .cert-image-card {
        width: 320px;
    }

    .cert-image-card .cert-image {
        height: 12rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .cert-image-card {
        width: 360px;
    }

    .cert-image-card .cert-image {
        height: 14rem;
    }
}

/* ===== PROJECTS HORIZONTAL SCROLL ===== */
.project-scroll-track {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 111, 97, 0.5) rgba(30, 41, 59, 0.5);
    -webkit-overflow-scrolling: touch;
}

.project-scroll-track::-webkit-scrollbar {
    height: 8px;
}

.project-scroll-track::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
}

.project-scroll-track::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, rgba(255, 111, 97, 0.6), rgba(14, 165, 233, 0.6));
    border-radius: 10px;
}

.project-scroll-track::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to right, rgba(255, 111, 97, 0.8), rgba(14, 165, 233, 0.8));
}

.project-card {
    cursor: grab;
}

.project-card:active {
    cursor: grabbing;
}

/* ===== TOOLS HORIZONTAL SCROLL ===== */
.tools-scroll-track {
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, 0.5) rgba(30, 41, 59, 0.5);
    -webkit-overflow-scrolling: touch;
}

.tools-scroll-track::-webkit-scrollbar {
    height: 8px;
}

.tools-scroll-track::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
}

.tools-scroll-track::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, rgba(14, 165, 233, 0.6), rgba(255, 111, 97, 0.6));
    border-radius: 10px;
}

.tools-scroll-track::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to right, rgba(14, 165, 233, 0.8), rgba(255, 111, 97, 0.8));
}

.tool-card {
    cursor: grab;
}

.tool-card:active {
    cursor: grabbing;
}

/* Interaction hint visibility based on device */
.hover-hint-desktop {
    display: flex;
}

.hover-hint-mobile {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .hover-hint-desktop {
        display: none;
    }
    
    .hover-hint-mobile {
        display: flex;
    }
}

/* ===== GLASSMORPHISM BUTTON STYLES ===== */
.glass-button-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.glass-button {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.glass-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.glass-button:hover::before {
    opacity: 1;
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.glass-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2);
}

/* Radio-style indicator */
.glass-radio-indicator {
    position: relative;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    overflow: visible;
    transition: all 0.3s ease;
}

.glass-button:hover .glass-radio-indicator {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

/* Sliding ball */
.glass-radio-ball {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    top: 50%;
    left: -30px;
    transform: translateY(-50%);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.glass-button:hover .glass-radio-ball {
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
}

/* Color variants */
.glass-button.coral .glass-radio-ball {
    background: linear-gradient(135deg, #ff6b4a, #ff7a59);
    box-shadow: 0 0 10px rgba(255, 107, 74, 0.5);
}

.glass-button.ocean .glass-radio-ball {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

.glass-button.slate .glass-radio-ball {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    box-shadow: 0 0 10px rgba(100, 116, 139, 0.5);
}

/* Text content */
.glass-button-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    transition: color 0.3s ease;
}

.glass-button:hover .glass-button-content {
    color: rgba(255, 255, 255, 1);
}

.glass-button-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.glass-button:hover .glass-button-icon {
    transform: scale(1.1);
}

/* Glow effect on hover */
.glass-button.coral:hover {
    box-shadow: 0 12px 40px 0 rgba(255, 107, 74, 0.3);
}

.glass-button.ocean:hover {
    box-shadow: 0 12px 40px 0 rgba(14, 165, 233, 0.3);
}

.glass-button.slate:hover {
    box-shadow: 0 12px 40px 0 rgba(100, 116, 139, 0.3);
}
