/*! tailwind-custom.css - Custom styles for Shahid Nadeem Portfolio */

/* Custom color extensions for Tailwind */
.bg-gradient-custom {
    background: linear-gradient(135deg, #00144F 0%, #3365A2 100%);
}

.text-gradient {
    background: linear-gradient(135deg, #00144F 0%, #3365A2 50%, #FF6B35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s infinite;
}

/* Custom utilities */
.aspect-ratio-16\/9 {
    aspect-ratio: 16/9;
}

.aspect-ratio-4\/3 {
    aspect-ratio: 4/3;
}

.aspect-ratio-1\/1 {
    aspect-ratio: 1/1;
}

/* Glass morphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-effect-dark {
    background: rgba(0, 20, 79, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #3365A2;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #00144F;
}

/* Dark mode scrollbar */
.dark .custom-scrollbar::-webkit-scrollbar-track {
    background: #1a202c;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #4a5568;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #2d3748;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break-before {
        page-break-before: always;
    }
    
    .print-break-after {
        page-break-after: always;
    }
    
    .print-break-inside-avoid {
        page-break-inside: avoid;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
    
    .gradient-bg {
        background: #00144F !important;
    }
    
    .text-dark-blue {
        color: black !important;
    }
    
    .text-med-blue {
        color: #333 !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gradient-bg {
        background: #000 !important;
    }
    
    .text-blue-100,
    .text-blue-200 {
        color: #fff !important;
    }
    
    .border-gray-300 {
        border-color: #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .card-hover:hover {
        transform: none !important;
    }
    
    .skill-bar {
        transition: none !important;
    }
    
    .fade-in {
        transition: none !important;
    }
}

/* Focus styles for accessibility */
.focus-ring:focus {
    outline: 2px solid #3365A2;
    outline-offset: 2px;
}

.focus-ring-dark:focus {
    outline: 2px solid #00144F;
    outline-offset: 2px;
}

/* Custom button styles */
.btn-primary {
    @apply bg-med-blue text-white px-6 py-3 rounded-lg font-semibold hover:bg-dark-blue transition-colors duration-300 focus:outline-none focus:ring-2 focus:ring-med-blue focus:ring-offset-2;
}

.btn-secondary {
    @apply border-2 border-med-blue text-med-blue px-6 py-3 rounded-lg font-semibold hover:bg-med-blue hover:text-white transition-colors duration-300 focus:outline-none focus:ring-2 focus:ring-med-blue focus:ring-offset-2;
}

.btn-outline {
    @apply border-2 border-white text-white px-6 py-3 rounded-lg font-semibold hover:bg-white hover:text-dark-blue transition-colors duration-300 focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2;
}

/* Custom card styles */
.card {
    @apply bg-white rounded-xl shadow-lg overflow-hidden transition-all duration-300;
}

.card-hover {
    @apply transition-all duration-300;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Custom form styles */
.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-med-blue focus:border-transparent outline-none transition-colors duration-300;
}

.form-label {
    @apply block text-gray-700 font-medium mb-2;
}

.form-error {
    @apply text-red-600 text-sm mt-1;
}

/* Custom badge styles */
.badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-sm font-medium;
}

.badge-primary {
    @apply bg-blue-100 text-blue-800;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

.badge-info {
    @apply bg-indigo-100 text-indigo-800;
}

/* Custom timeline styles */
.timeline-item {
    @apply relative pl-8 pb-8;
}

.timeline-item:last-child {
    @apply pb-0;
}

.timeline-item::before {
    content: '';
    @apply absolute left-0 top-2 w-4 h-4 bg-med-blue rounded-full border-4 border-white;
}

.timeline-item::after {
    content: '';
    @apply absolute left-2 top-6 bottom-0 w-0.5 bg-gray-300;
}

.timeline-item:last-child::after {
    @apply hidden;
}

/* Custom loading spinner */
.spinner {
    @apply animate-spin rounded-full border-2 border-gray-300 border-t-med-blue;
}

.spinner-sm {
    @apply w-4 h-4;
}

.spinner-md {
    @apply w-6 h-6;
}

.spinner-lg {
    @apply w-8 h-8;
}

/* Custom modal backdrop */
.modal-backdrop {
    @apply fixed inset-0 bg-black bg-opacity-75 transition-opacity duration-300;
}

.modal-content {
    @apply bg-white rounded-lg shadow-xl transform transition-all duration-300 sm:max-w-lg sm:w-full;
}

/* Custom tooltip */
.tooltip {
    @apply absolute invisible bg-gray-900 text-white text-sm px-2 py-1 rounded whitespace-nowrap transform -translate-x-1/2 -translate-y-full opacity-0 transition-all duration-300;
}

.tooltip-arrow {
    @apply absolute w-2 h-2 bg-gray-900 transform rotate-45 -translate-x-1/2;
}

.has-tooltip:hover .tooltip {
    @apply visible opacity-100;
}

/* Custom gradient text animations */
.gradient-text-animate {
    background: linear-gradient(135deg, #00144F 0%, #3365A2 50%, #FF6B35 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Custom section spacing */
.section-py {
    @apply py-16 md:py-20;
}

.section-pt {
    @apply pt-16 md:pt-20;
}

.section-pb {
    @apply pb-16 md:pb-20;
}

/* Container utilities */
.container-custom {
    @apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-8;
}

/* Grid utilities */
.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Aspect ratio containers for responsive iframes/videos */
.aspect-w-16 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}

.aspect-h-9 {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* Custom shadow utilities */
.shadow-custom {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.shadow-custom-lg {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Custom border utilities */
.border-gradient {
    border: double 2px transparent;
    background-image: linear-gradient(white, white), 
                      linear-gradient(135deg, #00144F 0%, #3365A2 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* Custom backdrop filters */
.backdrop-blur-custom {
    backdrop-filter: blur(12px);
}

/* Custom transition durations */
.transition-slow {
    transition-duration: 500ms;
}

.transition-slower {
    transition-duration: 700ms;
}

/* Custom z-index utilities */
.z-60 {
    z-index: 60;
}

.z-70 {
    z-index: 70;
}

.z-80 {
    z-index: 80;
}

.z-90 {
    z-index: 90;
}

.z-100 {
    z-index: 100;
}

/* Custom opacity utilities */
.opacity-10 {
    opacity: 0.1;
}

.opacity-20 {
    opacity: 0.2;
}

.opacity-30 {
    opacity: 0.3;
}

.opacity-40 {
    opacity: 0.4;
}

.opacity-60 {
    opacity: 0.6;
}

.opacity-70 {
    opacity: 0.7;
}

.opacity-80 {
    opacity: 0.8;
}

.opacity-90 {
    opacity: 0.9;
}

/* Custom line height utilities */
.leading-tighter {
    line-height: 1.1;
}

.leading-tightest {
    line-height: 1;
}

/* Custom letter spacing utilities */
.tracking-tighter {
    letter-spacing: -0.05em;
}

.tracking-tightest {
    letter-spacing: -0.1em;
}

/* Custom min/max width/height utilities */
.min-w-0 {
    min-width: 0px;
}

.min-w-full {
    min-width: 100%;
}

.min-h-0 {
    min-height: 0px;
}

.min-h-full {
    min-height: 100%;
}

.max-w-xs {
    max-width: 20rem;
}

.max-w-sm {
    max-width: 24rem;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-lg {
    max-width: 32rem;
}

.max-w-xl {
    max-width: 36rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-3xl {
    max-width: 48rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.max-w-5xl {
    max-width: 64rem;
}

.max-w-6xl {
    max-width: 72rem;
}

.max-w-7xl {
    max-width: 80rem;
}

.max-w-full {
    max-width: 100%;
}

.max-h-0 {
    max-height: 0px;
}

.max-h-full {
    max-height: 100%;
}

.max-h-screen {
    max-height: 100vh;
}

/* Custom cursor utilities */
.cursor-grab {
    cursor: grab;
}

.cursor-grabbing {
    cursor: grabbing;
}

.cursor-zoom-in {
    cursor: zoom-in;
}

.cursor-zoom-out {
    cursor: zoom-out;
}

/* Custom user select utilities */
.select-none {
    user-select: none;
}

.select-text {
    user-select: text;
}

.select-all {
    user-select: all;
}

.select-auto {
    user-select: auto;
}

/* Custom pointer events utilities */
.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}

/* Custom resize utilities */
.resize-none {
    resize: none;
}

.resize-y {
    resize: vertical;
}

.resize-x {
    resize: horizontal;
}

.resize {
    resize: both;
}

/* Custom scroll behavior utilities */
.scroll-auto {
    scroll-behavior: auto;
}

.scroll-smooth {
    scroll-behavior: smooth;
}

/* Custom overscroll behavior utilities */
.overscroll-auto {
    overscroll-behavior: auto;
}

.overscroll-contain {
    overscroll-behavior: contain;
}

.overscroll-none {
    overscroll-behavior: none;
}

.overscroll-y-auto {
    overscroll-behavior-y: auto;
}

.overscroll-y-contain {
    overscroll-behavior-y: contain;
}

.overscroll-y-none {
    overscroll-behavior-y: none;
}

.overscroll-x-auto {
    overscroll-behavior-x: auto;
}

.overscroll-x-contain {
    overscroll-behavior-x: contain;
}

.overscroll-x-none {
    overscroll-behavior-x: none;
}

/* Custom touch action utilities */
.touch-auto {
    touch-action: auto;
}

.touch-none {
    touch-action: none;
}

.touch-pan-x {
    touch-action: pan-x;
}

.touch-pan-left {
    touch-action: pan-left;
}

.touch-pan-right {
    touch-action: pan-right;
}

.touch-pan-y {
    touch-action: pan-y;
}

.touch-pan-up {
    touch-action: pan-up;
}

.touch-pan-down {
    touch-action: pan-down;
}

.touch-pinch-zoom {
    touch-action: pinch-zoom;
}

.touch-manipulation {
    touch-action: manipulation;
}

/* Custom will-change utilities */
.will-change-auto {
    will-change: auto;
}

.will-change-scroll {
    will-change: scroll-position;
}

.will-change-contents {
    will-change: contents;
}

.will-change-transform {
    will-change: transform;
}

/* Custom filter utilities */
.filter-none {
    filter: none;
}

.filter {
    filter: var(--tw-filter);
}

/* Custom backdrop filter utilities */
.backdrop-filter-none {
    backdrop-filter: none;
}

.backdrop-filter {
    backdrop-filter: var(--tw-backdrop-filter);
}

/* Custom mix blend mode utilities */
.mix-blend-normal {
    mix-blend-mode: normal;
}

.mix-blend-multiply {
    mix-blend-mode: multiply;
}

.mix-blend-screen {
    mix-blend-mode: screen;
}

.mix-blend-overlay {
    mix-blend-mode: overlay;
}

.mix-blend-darken {
    mix-blend-mode: darken;
}

.mix-blend-lighten {
    mix-blend-mode: lighten;
}

.mix-blend-color-dodge {
    mix-blend-mode: color-dodge;
}

.mix-blend-color-burn {
    mix-blend-mode: color-burn;
}

.mix-blend-hard-light {
    mix-blend-mode: hard-light;
}

.mix-blend-soft-light {
    mix-blend-mode: soft-light;
}

.mix-blend-difference {
    mix-blend-mode: difference;
}

.mix-blend-exclusion {
    mix-blend-mode: exclusion;
}

.mix-blend-hue {
    mix-blend-mode: hue;
}

.mix-blend-saturation {
    mix-blend-mode: saturation;
}

.mix-blend-color {
    mix-blend-mode: color;
}

.mix-blend-luminosity {
    mix-blend-mode: luminosity;
}

/* Custom background blend mode utilities */
.bg-blend-normal {
    background-blend-mode: normal;
}

.bg-blend-multiply {
    background-blend-mode: multiply;
}

.bg-blend-screen {
    background-blend-mode: screen;
}

.bg-blend-overlay {
    background-blend-mode: overlay;
}

.bg-blend-darken {
    background-blend-mode: darken;
}

.bg-blend-lighten {
    background-blend-mode: lighten;
}

.bg-blend-color-dodge {
    background-blend-mode: color-dodge;
}

.bg-blend-color-burn {
    background-blend-mode: color-burn;
}

.bg-blend-hard-light {
    background-blend-mode: hard-light;
}

.bg-blend-soft-light {
    background-blend-mode: soft-light;
}

.bg-blend-difference {
    background-blend-mode: difference;
}

.bg-blend-exclusion {
    background-blend-mode: exclusion;
}

.bg-blend-hue {
    background-blend-mode: hue;
}

.bg-blend-saturation {
    background-blend-mode: saturation;
}

.bg-blend-color {
    background-blend-mode: color;
}

.bg-blend-luminosity {
    background-blend-mode: luminosity;
}

/* Mobile Responsiveness Fixes - Enhanced */
@media (max-width: 768px) {
  /* Portfolio filter buttons spacing */
  .flex.flex-wrap.justify-center.mb-12 .portfolio-filter {
    margin: 0.5rem !important;
    padding: 0.75rem 1.25rem !important;
    width: calc(50% - 1rem);
    text-align: center;
    font-size: 0.9rem;
  }
  
  /* Hero section buttons spacing */
  .gradient-bg .space-x-4 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.1rem !important;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
  
  .gradient-bg .space-x-4 a {
    margin: 0.5rem 0 !important;
    display: block;
    width: 100% !important;
    text-align: center;
  }
  
  /* Portfolio item spacing */
  #portfolio-grid .portfolio-item {
    margin-bottom: 2.5rem !important;
  }
  
  /* Contact info items spacing */
  #contact .flex.items-center {
    margin-bottom: 1.5rem !important;
    padding: 0.5rem 0;
  }
  
  /* Navigation menu spacing */
  nav ul li {
    margin: 0.75rem 0 !important;
    padding: 0.5rem 0;
  }
  
  /* Timeline items spacing */
  .timeline-line .flex.items-start {
    margin-bottom: 2.5rem !important;
  }
  
  /* Testimonial card spacing */
  #testimonials .card-hover {
    margin-bottom: 2rem !important;
  }
  
  /* Skill bars spacing */
  .space-y-6 > div {
    margin-bottom: 1.75rem !important;
  }
  
  /* General section spacing */
  section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  /* Grid item spacing */
  .grid > * {
    margin-bottom: 2rem !important;
  }
}

/* Additional mobile fixes for very small screens */
@media (max-width: 480px) {
  /* Portfolio filter buttons on very small screens */
  .flex.flex-wrap.justify-center.mb-12 .portfolio-filter {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.6rem 1rem !important;
    margin: 0.35rem 0 !important;
  }
  
  /* Contact section buttons */
  #contact .space-x-4 {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  #contact .space-x-4 a {
    margin: 0.5rem 0 !important;
    width: 100% !important;
    text-align: center;
  }
  
  /* Reduce hero text size on very small devices */
  .gradient-bg h1 {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
  }
  
  .gradient-bg p.text-xl {
    font-size: 1.1rem !important;
    margin: 1rem 0 !important;
  }
  
  .gradient-bg p.text-lg {
    font-size: 1rem !important;
    margin: 0.75rem 0 !important;
  }
  
  /* Increase spacing in about section stats */
  .grid.grid-cols-2.gap-4 {
    gap: 0.75rem !important;
  }
  
  .grid.grid-cols-2.gap-4 > div {
    padding: 1rem 0.5rem !important;
    margin: 0.25rem 0 !important;
  }
}

/* Emergency override for mobile spacing issues */
@media (max-width: 768px) {
  /* Force spacing between adjacent elements */
  .mb-4, .mb-6, .mb-8, .mb-12, .mb-16 {
    margin-bottom: 1.5rem !important;
  }
  
  .mt-4, .mt-6, .mt-8, .mt-12, .mt-16 {
    margin-top: 1.5rem !important;
  }
  
  /* Specific spacing for portfolio items */
  .portfolio-item {
    margin-bottom: 2rem !important;
  }
  
  #home .space-x-4 a {
    margin: 0.5rem 0 !important;
    width: 100% !important;
    max-width: 280px;
  }
  
  /* Contact form spacing */
  .contact-form .space-y-6 > * {
    margin-bottom: 1.5rem !important;
  }
}

/* Fix for touch targets on mobile */
@media (max-width: 768px) {
  button, a, .portfolio-filter {
    min-height: 44px !important;
    min-width: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Ensure proper tap targets */
  .portfolio-filter {
    padding: 12px 16px !important;
  }
  
  /* Fix for navigation items */
  nav a {
    padding: 12px 16px !important;
    display: block !important;
  }
}

/* EMERGENCY FIX FOR PORTFOLIO FILTER BUTTONS - HIGH SPECIFICITY */
@media (max-width: 768px) {
  /* Target the specific portfolio filter container */
  #portfolio .flex.flex-wrap.justify-center.mb-12 {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 12px !important; /* Increased gap */
    margin: 0 -6px !important; /* Negative margin to compensate for gap */
    padding: 0 8px !important;
  }
  
  /* Target each portfolio filter button with high specificity */
  #portfolio .portfolio-filter {
    margin: 6px !important;
    padding: 12px 20px !important;
    flex: 0 0 calc(50% - 24px) !important; /* 50% width minus gap */
    max-width: calc(50% - 24px) !important;
    min-height: 48px !important;
    border-radius: 9999px !important;
    border: 2px solid #e5e7eb !important;
    background: white !important;
    color: #374151 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
  }
  
  /* Active state */
  #portfolio .portfolio-filter.active {
    background-color: #3365A2 !important;
    color: white !important;
    border-color: #3365A2 !important;
  }
  
  /* Hover states */
  #portfolio .portfolio-filter:hover:not(.active) {
    border-color: #3365A2 !important;
    color: #3365A2 !important;
  }
  
  #portfolio .portfolio-filter.active:hover {
    background-color: #00144F !important;
    border-color: #00144F !important;
  }
}

/* For very small screens - single column */
@media (max-width: 480px) {
  #portfolio .flex.flex-wrap.justify-center.mb-12 {
    gap: 10px !important;
    margin: 0 -5px !important;
  }
  
  #portfolio .portfolio-filter {
    flex: 0 0 calc(100% - 20px) !important; /* Full width minus gap */
    max-width: calc(100% - 20px) !important;
    margin: 5px !important;
    padding: 14px 20px !important;
    font-size: 15px !important;
  }
}

/* NUCLEAR OPTION - Add this if nothing else works */
@media (max-width: 768px) {
  #portfolio .flex.flex-wrap.justify-center.mb-12 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 8px !important;
  }
  
  #portfolio .portfolio-filter {
    margin: 0 !important;
    padding: 14px 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 50px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  #portfolio .flex.flex-wrap.justify-center.mb-12 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  
  #portfolio .portfolio-filter {
    padding: 16px 20px !important;
    font-size: 15px !important;
  }
}