/* Prabhu Kasinathan - Responsive Styles */
/* Mobile-First Responsive Design — Personal Portfolio breakpoints */

/* ===== BREAKPOINT VARIABLES ===== */
:root {
  --breakpoint-sm: 480px;   /* Small mobile */
  --breakpoint-md: 768px;   /* Tablet */
  --breakpoint-lg: 1024px;  /* Desktop */
  --breakpoint-xl: 1440px;  /* Large desktop */
  --breakpoint-2xl: 1920px; /* Extra large */
}

/* ===== BASE MOBILE STYLES (320px+) ===== */
/* These are the default styles, mobile-first approach */

/* Navigation - Mobile */
@media (max-width: 767px) {
  .nav-menu {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-cta .btn {
    font-size: var(--text-small);
    padding: var(--space-2) var(--space-4);
  }
  
  .nav-cta .btn-text {
    display: none; /* Hide text, show only icon on mobile */
  }
  
  .mobile-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    transform: translateY(-100%);
    transition: transform var(--transition-normal);
    z-index: 999;
  }
  
  .mobile-nav[aria-hidden="false"] {
    display: block;
    transform: translateY(0);
  }
  
  .mobile-nav-menu {
    list-style: none;
    padding: var(--space-4);
    margin: 0;
  }
  
  .mobile-nav-link {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: var(--gray-300);
    font-size: var(--text-body);
    font-weight: var(--weight-medium);
    transition: all var(--transition-normal);
  }
  
  .mobile-nav-link:hover,
  .mobile-nav-link.active {
    color: var(--white);
    background: rgba(229, 9, 20, 0.1);
  }
}

/* Hero Section - Mobile */
@media (max-width: 767px) {
  .hero-section {
    min-height: 100vh;
    padding-top: 80px; /* Account for fixed nav */
  }
  
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }
  
  .hero-title {
    font-size: clamp(2.5rem, 10vw, 4rem);
    line-height: 1.1;
  }
  
  .hero-subtitle {
    font-size: var(--text-large);
  }
  
  .hero-tagline {
    font-size: var(--text-body);
  }
  
  .hero-description {
    font-size: var(--text-body);
    max-width: 100%;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }
  
  .hero-cta .btn {
    width: 100%;
    max-width: 280px;
  }
  
  .avatar-image {
    width: 200px;
    height: 200px;
  }
}

/* About Section - Mobile */
@media (max-width: 767px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }
  
  .about-photo {
    width: 250px;
    height: 300px;
    margin: 0 auto;
  }
  
  .about-text {
    max-width: 100%;
  }
  
  .about-highlights {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* Achievements Section - Mobile */
@media (max-width: 767px) {
  .achievements-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .achievement-card {
    padding: var(--space-6);
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  
  .card-metrics {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
  
  .card-tech-stack {
    justify-content: center;
  }
}

/* Skills Section - Mobile */
@media (max-width: 767px) {
  .skills-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .skill-category {
    padding: var(--space-6);
  }
  
  .skill-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
  
  .skill-name {
    flex: none;
    margin-bottom: var(--space-1);
  }
  
  .skill-level {
    width: 100%;
  }
}

/* Portfolio Section - Mobile */
@media (max-width: 767px) {
  .portfolio-filter {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }
  
  .filter-btn {
    width: 100%;
    max-width: 200px;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .portfolio-card:hover {
    transform: none; /* Disable hover transform on mobile */
  }
}

/* Testimonials Section - Mobile */
@media (max-width: 767px) {
  .testimonials-grid {
    gap: var(--space-6);
  }
  
  .testimonial-card {
    padding: var(--space-6);
  }
  
  .testimonial-quote {
    font-size: var(--text-body);
    padding-left: var(--space-6);
  }
  
  .testimonial-card::before {
    font-size: 3rem;
    left: var(--space-4);
  }
}

/* Contact Section - Mobile */
@media (max-width: 767px) {
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  
  .contact-methods {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: var(--space-8) auto;
    gap: var(--space-4);
    justify-content: center;
    justify-items: center;
  }
  
  /* Reset last-child styling on mobile */
  .contact-methods .contact-method:last-child {
    grid-column: auto;
    max-width: 300px;
    margin: 0 auto;
    grid-template-columns: 48px auto;
    justify-content: center;
  }
  
  .contact-form {
    padding: var(--space-6);
  }
}

/* Footer - Mobile */
@media (max-width: 767px) {
  .footer-links {
    flex-direction: column;
    gap: var(--space-4);
  }
  
  .footer-social {
    gap: var(--space-4);
  }
  
  .social-link {
    width: 40px;
    height: 40px;
  }
}

/* ===== SMALL MOBILE STYLES (480px+) ===== */
@media (min-width: 480px) {
  .hero-cta {
    flex-direction: row;
    justify-content: center;
  }
  
  .hero-cta .btn {
    width: auto;
  }
  
  .about-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .card-metrics {
    flex-direction: row;
    justify-content: space-around;
  }
  
  .contact-methods {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: var(--space-8) auto;
    gap: var(--space-4);
    justify-content: center;
    justify-items: center;
  }
  
  /* Reset last-child styling on small mobile */
  .contact-methods .contact-method:last-child {
    grid-column: auto;
    max-width: 300px;
    margin: 0 auto;
    grid-template-columns: 48px auto;
    justify-content: center;
  }
}

/* ===== TABLET STYLES (768px+) ===== */
@media (min-width: 768px) {
  /* Contact section - Tablet */
  .contact-methods {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5) var(--space-6);
    max-width: 500px;
    margin: var(--space-8) auto;
    justify-content: center;
    justify-items: center;
  }
  
  .contact-methods .contact-method:last-child {
    grid-column: 1 / -1;
    max-width: 300px;
    margin: 0 auto;
    grid-template-columns: 48px auto;
    justify-content: center;
  }
  /* Navigation - Tablet */
  .nav-menu {
    display: flex;
  }
  
  .mobile-menu-toggle {
    display: none;
  }
  
  .nav-cta .btn:last-child {
    display: inline-flex;
  }
  
  /* Hero Section - Tablet */
  .hero-container {
    grid-template-columns: 1fr 300px;
    gap: var(--space-12);
    text-align: left;
  }
  
  .hero-text {
    text-align: left;
  }
  
  .hero-cta {
    justify-content: flex-start;
  }
  
  .avatar-image {
    width: 300px;
    height: 300px;
  }
  
  /* About Section - Tablet */
  .about-content {
    grid-template-columns: 300px 1fr;
    gap: var(--space-12);
    text-align: left;
  }
  
  .about-text {
    max-width: none;
  }
  
  .about-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Achievements Section - Tablet */
  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
    align-items: stretch;
  }
  
  .card-header {
    flex-direction: row;
    align-items: flex-start;
  }
  
  .card-metrics {
    flex-direction: row;
    justify-content: flex-start;
  }
  
  /* Skills Section - Tablet */
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }
  
  .skill-item {
    flex-direction: row;
    align-items: center;
  }
  
  .skill-name {
    flex: 0 0 120px;
  }
  
  /* Portfolio Section - Tablet */
  .portfolio-filter {
    flex-direction: row;
  }
  
  .filter-btn {
    width: auto;
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }
  
  /* Testimonials Section - Tablet */
  .testimonials-grid {
    gap: var(--space-8);
  }
  .testimonial-card { width: 100%; }
  
  /* Contact Section - Tablet */
  .contact-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
  
  /* Footer - Tablet */
  .footer-links {
    flex-direction: row;
    gap: var(--space-8);
  }
}

/* ===== DESKTOP STYLES (1024px+) ===== */
@media (min-width: 1024px) {
  /* Navigation - Desktop */
  .nav-container {
    padding: var(--space-4) var(--space-8);
  }
  
  .nav-menu {
    gap: var(--space-10);
  }
  
  /* Hero Section - Desktop */
  .hero-container {
    grid-template-columns: 1fr 350px;
    gap: var(--space-16);
  }
  
  .avatar-image {
    width: 350px;
    height: 350px;
  }
  
  /* About Section - Desktop */
  .about-content {
    grid-template-columns: 350px 1fr;
    gap: var(--space-16);
  }
  
  .about-highlights {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Achievements Section - Desktop */
  .achievements-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-10);
    align-items: stretch;
  }
  
  /* Skills Section - Desktop */
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-10);
  }
  
  /* Portfolio Section - Desktop */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-10);
  }
  
  .portfolio-card:hover {
    transform: scale(1.02); /* Re-enable hover effects */
  }
  
  /* Testimonials Section - Desktop */
  .testimonials-grid {
    gap: var(--space-10);
  }
  .testimonial-card { width: 100%; }
  
  /* Contact Section - Desktop */
  .contact-content {
    max-width: 1000px;
    margin: 0 auto;
  }
  /* Two columns for contact methods on desktop */
  .contact-methods {
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
    margin: var(--space-8) auto;
    gap: var(--space-5) var(--space-10);
    justify-content: center;
    justify-items: center;
  }
  
  .contact-methods .contact-method:last-child {
    grid-column: 1 / -1;
    max-width: 300px;
    margin: 0 auto;
    grid-template-columns: 48px auto;
    justify-content: center;
  }
}

/* ===== LARGE DESKTOP STYLES (1440px+) ===== */
@media (min-width: 1440px) {
  /* Container adjustments */
  .container {
    padding: 0 var(--space-8);
  }
  
  /* Hero Section - Large Desktop */
  .hero-container {
    grid-template-columns: 1fr 400px;
    gap: var(--space-20);
  }
  
  .avatar-image {
    width: 400px;
    height: 400px;
  }
  
  /* About Section - Large Desktop */
  .about-content {
    grid-template-columns: 400px 1fr;
    gap: var(--space-20);
  }
  
  /* Achievements Section - Large Desktop */
  .achievements-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-12);
    align-items: stretch;
  }
  
  /* Skills Section - Large Desktop */
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-12);
  }
  
  /* Portfolio Section - Large Desktop */
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-12);
  }
  
  /* Testimonials Section - Large Desktop */
  .testimonials-grid {
    gap: var(--space-12);
  }
  .testimonial-card { width: 100%; }
}

/* ===== EXTRA LARGE DESKTOP STYLES (1920px+) ===== */
@media (min-width: 1920px) {
  /* Achievements Section - Extra Large */
  .achievements-grid {
    grid-template-columns: repeat(4, 1fr);
    align-items: stretch;
  }
  
  /* Skills Section - Extra Large */
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Portfolio Section - Extra Large */
  .portfolio-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== LANDSCAPE MOBILE STYLES ===== */
@media (max-width: 767px) and (orientation: landscape) {
  .hero-section {
    min-height: 100vh;
  }
  
  .hero-container {
    grid-template-columns: 1fr 200px;
    gap: var(--space-8);
  }
  
  .avatar-image {
    width: 180px;
    height: 180px;
  }
  
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
  
  .navigation,
  .mobile-menu-toggle,
  .hero-cta,
  .contact-form,
  .footer-social {
    display: none !important;
  }
  
  .hero-section {
    min-height: auto;
    padding: var(--space-8) 0;
  }
  
  section {
    padding: var(--space-8) 0;
    page-break-inside: avoid;
  }
  
  .achievement-card,
  .portfolio-card,
  .testimonial-card {
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
  }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover effects on touch devices */
  .card:hover,
  .achievement-card:hover,
  .portfolio-card:hover,
  .testimonial-card:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  /* Increase touch targets */
  .btn,
  .nav-link,
  .filter-btn {
    min-height: 48px;
    padding: var(--space-4) var(--space-6);
  }
  
  .social-link {
    width: 52px;
    height: 52px;
  }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize for retina displays */
  .avatar-image,
  .about-photo,
  .author-avatar {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ===== REDUCED MOTION PREFERENCES ===== */
@media (prefers-reduced-motion: reduce) {
  .hero-container,
  .about-content,
  .achievements-grid,
  .skills-grid,
  .portfolio-grid,
  .testimonials-grid,
  .contact-content {
    animation: none;
  }
  
  .card:hover,
  .achievement-card:hover,
  .portfolio-card:hover,
  .testimonial-card:hover {
    transform: none;
  }
}

/* Force dark theme always: remove light mode overrides */

/* ===== CONTAINER QUERIES (Future Enhancement) ===== */
/* These will be activated when container queries have better support */
/*
@container (min-width: 768px) {
  .achievement-card {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
}
*/

/* ===== UTILITY CLASSES FOR RESPONSIVE BEHAVIOR ===== */

/* Hide/Show at different breakpoints */
.hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: block;
  }
  
  .hide-tablet {
    display: none;
  }
}

@media (min-width: 1024px) {
  .hide-tablet {
    display: block;
  }
  
  .hide-desktop {
    display: none;
  }
}

.show-mobile-only {
  display: block;
}

@media (min-width: 768px) {
  .show-mobile-only {
    display: none;
  }
}

/* Responsive text alignment */
.text-center-mobile {
  text-align: center;
}

@media (min-width: 768px) {
  .text-center-mobile {
    text-align: left;
  }
}

/* Responsive spacing */
.spacing-mobile {
  padding: var(--space-4);
}

@media (min-width: 768px) {
  .spacing-mobile {
    padding: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .spacing-mobile {
    padding: var(--space-8);
  }
}

/* Responsive grid gaps */
.grid-gap-responsive {
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .grid-gap-responsive {
    gap: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .grid-gap-responsive {
    gap: var(--space-8);
  }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Focus indicators for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  .nav-link:focus,
  .btn:focus,
  .form-input:focus {
    transition: outline-offset 0.2s ease;
  }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
  .card,
  .achievement-card,
  .portfolio-card,
  .testimonial-card,
  .contact-form {
    border-width: 2px;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* Large text preferences */
@media (prefers-reduced-data: reduce) {
  /* Optimize for users with data constraints */
  .card-image img,
  .avatar-image,
  .about-photo {
    content-visibility: auto;
  }
}
