/* ==========================================================================
   RESPONSIVE CSS
   Mobile-first approach for optimal user experience
   ========================================================================== */

/* ==========================================================================
   TABLET STYLES (768px and below)
   ========================================================================== */
@media (max-width: 768px) {
  /* Base adjustments */
  .section {
    padding: var(--spacing-xl) 0;
  }

  .container {
    padding: 0 1.5rem;
  }

  /* Typography */
  h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
    line-height: 1.2;
  }

  h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    line-height: 1.3;
  }

  p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .section-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  /* Navigation */
  .navbar-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  }

  .navbar-nav .nav-item {
    margin-bottom: 0.5rem;
  }

  .navbar-nav .nav-item:last-child {
    margin-bottom: 0;
  }

  .navbar-nav .nav-link {
    color: var(--text-primary) !important;
    padding: 0.75rem 1rem !important;
    border-radius: var(--border-radius);
    transition: all var(--transition-base);
  }

  .navbar-nav .nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color) !important;
  }

  .cta-btn {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
  }

  /* Hero Section */
  .hero_wrapper {
    min-height: 50vh;
    padding: 80px 0 40px;
  }

  .hero-background {
    background: transparent;
  }

  .hero-content {
    text-align: center;
    padding: 2rem 1.5rem;
    background: none !important;
    border-radius: var(--border-radius-lg);
    backdrop-filter: none;
    border: none;
    margin: 0 1rem;
    box-shadow: none;
    max-width: 100%;
  }

  .hero-greeting {
    font-weight: 600;
    text-shadow: 
      2px 2px 4px rgba(0, 0, 0, 0.9),
      0 0 10px rgba(0, 0, 0, 0.8),
      0 0 20px rgba(0, 0, 0, 0.6);
  }

  .hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ffffff !important;
    text-shadow: 
      3px 3px 6px rgba(0, 0, 0, 0.9),
      0 0 15px rgba(0, 0, 0, 0.8),
      0 0 30px rgba(0, 0, 0, 0.6);
    font-weight: 800;
  }

  .hero-description {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #ffffff !important;
    text-shadow: 
      2px 2px 4px rgba(0, 0, 0, 0.9),
      0 0 10px rgba(0, 0, 0, 0.8),
      0 0 20px rgba(0, 0, 0, 0.6);
    font-weight: 500;
  }

  .hero-cta {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-cta .main-btn {
    width: 100%;
    justify-content: center;
  }

  .scroll-indicator {
    bottom: 1rem;
  }

  /* About Section */
  .about-image {
    margin-bottom: 3rem;
  }

  .about-img {
    max-width: 280px;
    margin: 0 auto;
  }

  .about-badge {
    position: static;
    margin-top: 1rem;
    margin-bottom: 2rem;
    display: inline-block;
  }

  .about-tabs .nav-pills {
    flex-direction: column;
    background: transparent;
    gap: 0.5rem;
    padding: 0;
  }

  .about-tabs .nav-link {
    width: 100%;
    text-align: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
  }

  .about-tabs .nav-link.active {
    background: var(--primary-color);
  }

  .skills-grid {
    gap: 2rem;
  }

  .skill-header {
    justify-content: space-between;
  }

  .certificates-list {
    gap: 1rem;
  }

  .certificate-item {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }

  .certificate-item i {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .tech-stack {
    gap: 1.5rem;
  }

  .tech-items {
    justify-content: center;
  }

  .education-item {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .education-year {
    margin-bottom: 1rem;
  }

  /* Achievements Section */
  .achievement-card {
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
  }

  .achievement-card:hover {
    transform: translateY(-5px);
  }

  .achievement-icon {
    margin: 0 auto 1.5rem;
  }

  .achievement-image {
    height: 180px;
    margin: 0 auto 1.5rem;
  }

  .leetcode-stats {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .stat-item {
    padding: 0.5rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .achievement-highlights {
    text-align: left;
  }

  /* Experience Section */
  .experience-timeline::before {
    left: 30px;
    transform: none;
  }

  .timeline-item {
    padding-left: 3rem;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    flex-direction: column !important;
  }

  .timeline-item:nth-child(odd) .timeline-date,
  .timeline-item:nth-child(even) .timeline-date {
    text-align: left !important;
    flex: none;
    width: 100%;
  }

  .timeline-date {
    flex: none !important;
    padding: 0.5rem 0;
  }

  .timeline-date::after {
    left: 20px !important;
    right: auto !important;
  }

  .date-badge {
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
    min-width: 100px;
  }

  .timeline-content {
    margin-left: 0;
    width: 100%;
    flex: none !important;
  }

  .timeline-content::before {
    display: none;
  }

  .company-logo {
    width: 50px;
    height: 50px;
  }

  .experience-details h4 {
    font-size: 1.25rem;
  }

  .experience-details h5 {
    font-size: 1rem;
  }

  .experience-achievements .achievement-item {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  /* Services Section */
  .services_wrapper .row {
    gap: 2rem;
  }

  .service-card {
    padding: 2rem 1.5rem;
    text-align: center;
  }

  .service-card:hover {
    transform: translateY(-5px);
  }

  .service-icon {
    margin: 0 auto 1.5rem;
  }

  .service-features {
    text-align: left;
  }

  /* Portfolio Section */
  .portfolio-card {
    height: 280px;
    margin-bottom: 2rem;
  }

  .portfolio-overlay {
    padding: 1.5rem;
  }

  .portfolio-content {
    text-align: center;
  }

  .portfolio-links {
    justify-content: center;
  }

  /* Contact Section */
  .contact-content {
    padding-right: 0;
    margin-bottom: 3rem;
    text-align: center;
  }

  .contact-info {
    gap: 2rem;
    margin-bottom: 2rem;
  }

  .contact-item {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .contact-form {
    padding: 2rem 1.5rem;
  }

  .form-control {
    padding: 1rem;
    font-size: 1rem;
  }

  /* Footer */
  .footer_wrapper {
    padding: 2rem 0;
  }

  .footer_wrapper .row {
    gap: 2rem;
  }

  .footer-brand {
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }

  .footer-copyright {
    text-align: center;
  }

  /* Utility classes for mobile */
  .scroll-to-top {
    bottom: 20px !important;
    right: 20px !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 1.1rem !important;
  }
}

/* ==========================================================================
   SMALL MOBILE STYLES (480px and below)
   ========================================================================== */
@media (max-width: 480px) {
  /* Base adjustments */
  .container {
    padding: 0 1rem;
  }

  .section {
    padding: var(--spacing-lg) 0;
  }

  /* Typography */
  h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  h2 {
    font-size: clamp(1.25rem, 6vw, 1.75rem);
  }

  .section-subtitle {
    font-size: 0.75rem;
    padding-left: 1.5rem;
  }

  .section-subtitle::before {
    width: 1rem;
  }

  /* Navigation */
  .navbar {
    padding: 0.75rem 0;
  }

  .navbar-brand .brand-text {
    font-size: 1.25rem;
  }

  .navbar-nav {
    padding: 0.75rem;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  /* Hero Section */
  .hero_wrapper {
    padding: 4rem 0 2rem;
    min-height: 50vh;
  }

  .hero-background {
    background: transparent !important;
  }

  .hero-content {
    background: rgba(0, 0, 0, 0.85) !important;
    padding: 1.5rem 1rem;
    margin: 0 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }

  .hero-greeting {
    font-size: 1rem;
    color: #ffffff !important;
    text-shadow: 
      2px 2px 4px rgba(0, 0, 0, 0.9),
      0 0 10px rgba(0, 0, 0, 0.8),
      0 0 20px rgba(0, 0, 0, 0.6);
    font-weight: 600;
  }

  .hero-title {
    color: #ffffff !important;
    text-shadow: 
      3px 3px 6px rgba(0, 0, 0, 0.9),
      0 0 15px rgba(0, 0, 0, 0.8),
      0 0 30px rgba(0, 0, 0, 0.6);
    font-weight: 800;
  }

  .hero-description {
    font-size: 1rem;
    color: #ffffff !important;
    text-shadow: 
      2px 2px 4px rgba(0, 0, 0, 0.9),
      0 0 10px rgba(0, 0, 0, 0.8),
      0 0 20px rgba(0, 0, 0, 0.6);
    font-weight: 500;
  }

  .image-container {
    width: 220px;
    height: 220px;
  }

  .hero-cta .main-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
  }

  /* About Section */
  .about-img {
    max-width: 220px;
  }

  .about-badge {
    padding: 0.75rem 1rem;
  }

  .about-badge span {
    font-size: 1.25rem;
  }

  .about-tabs .nav-link {
    padding: 0.75rem;
    font-size: 0.875rem;
  }

  .skill-header h6 {
    font-size: 0.9rem;
  }

  .certificate-item {
    padding: 1rem;
  }

  .certificate-item i {
    font-size: 1.5rem;
  }

  .tech-item {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  /* Achievements Section */
  .achievement-card {
    padding: 1.5rem 1rem;
  }

  .achievement-icon {
    width: 60px;
    height: 60px;
  }

  .achievement-image {
    height: 140px;
  }

  .achievement-content h3 {
    font-size: 1.25rem;
  }

  .achievement-content p {
    font-size: 0.9rem;
  }

  .leetcode-stats {
    padding: 1rem 0.5rem;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  /* Experience Section */
  .timeline-item {
    padding-left: 2.5rem;
  }

  .timeline-content {
    padding: 1.5rem 1rem;
  }

  .experience-details h4 {
    font-size: 1.25rem;
  }

  .experience-details h5 {
    font-size: 1rem;
  }

  .company-logo {
    width: 50px;
    height: 50px;
  }

  .experience-achievements .achievement-item {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  /* Services Section */
  .service-card {
    padding: 1.5rem 1rem;
  }

  .service-icon {
    width: 60px;
    height: 60px;
  }

  .service-content h3 {
    font-size: 1.25rem;
  }

  .service-content p {
    font-size: 0.9rem;
  }

  .service-features {
    font-size: 0.8rem;
  }

  /* Portfolio Section */
  .portfolio-card {
    height: 240px;
  }

  .portfolio-overlay {
    padding: 1rem;
  }

  .portfolio-content h4 {
    font-size: 1.125rem;
  }

  .portfolio-content p {
    font-size: 0.8rem;
  }

  .portfolio-links .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  /* Contact Section */
  .contact-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .contact-form {
    padding: 1.5rem 1rem;
  }

  .form-control {
    padding: 0.875rem;
    font-size: 0.9rem;
  }

  /* Footer */
  .social-links a {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .footer-copyright p {
    font-size: 0.8rem;
  }

  /* Utility adjustments */
  .scroll-to-top {
    bottom: 15px !important;
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 1rem !important;
  }
}

/* ==========================================================================
   LARGE DESKTOP STYLES (1200px and above)
   ========================================================================== */
@media (min-width: 1200px) {
  .container {
    max-width: 1400px;
    padding: 0 2rem;
  }

  /* Hero Section */
  .hero_wrapper {
    padding: 8rem 0 6rem;
  }

  .hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
  }

  .hero-description {
    font-size: 1.375rem;
    max-width: 600px;
  }

  /* About Section */
  .about-img {
    max-width: 450px;
  }

  /* Services Section */
  .service-card {
    padding: 3rem 2rem;
  }

  .service-icon {
    width: 100px;
    height: 100px;
  }

  /* Portfolio Section */
  .portfolio-card {
    height: 400px;
  }

  /* Contact Section */
  .contact-content {
    padding-right: 3rem;
  }

  .contact-form {
    padding: 3rem 2.5rem;
  }
}

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

  .floating-element {
    animation: none !important;
  }

  .scroll-indicator {
    animation: none !important;
  }

  .hero-background {
    background-attachment: scroll;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #333333;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --border-color: #666666;
  }

  .service-card,
  .portfolio-card,
  .contact-form {
    border: 2px solid var(--border-color);
  }
}

/* Print styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .header_wrapper,
  .footer_wrapper,
  .floating-elements,
  .scroll-indicator,
  .scroll-to-top,
  .loading-screen {
    display: none !important;
  }

  .hero_wrapper,
  .about_wrapper,
  .services_wrapper,
  .portfolio_wrapper,
  .contact_wrapper {
    page-break-inside: avoid;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }

  .container {
    max-width: none;
    padding: 0;
  }
}

/* ==========================================================================
   ORIENTATION CHANGES
   ========================================================================== */
@media (orientation: landscape) and (max-height: 600px) {
  .hero_wrapper {
    padding: 4rem 0 2rem;
  }

  .hero-content {
    padding: 1rem 0;
  }

  .scroll-indicator {
    display: none;
  }
}

/* ==========================================================================
   HOVER SUPPORT
   ========================================================================== */
@media (hover: none) {
  .service-card:hover,
  .portfolio-card:hover,
  .nav-link:hover {
    transform: none;
  }

  .portfolio-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.8);
  }
}

/* ==========================================================================
   DARK MODE SUPPORT (Future Enhancement)
   ========================================================================== */
@media (prefers-color-scheme: light) {
  /* Light mode overrides could go here if needed */
  .hero-background {
    opacity: 0.05;
  }
}

/* ==========================================================================
   FOCUS MANAGEMENT
   ========================================================================== */
@media (any-hover: none) {
  .nav-link:focus,
  .main-btn:focus,
  .form-control:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }
}

.hero-text {
    /* Ensure text is visible without the black box */
    background: none;
    /* Other existing styles */
    color: white;
    font-size: 2.5em;
    text-align: center;
    /* ... existing code ... */
}
