/*-----------------------------------*\
  # RESPONSIVE GLOBAL
\*-----------------------------------*/

/* XL Devices - Pantallas muy grandes (1400px+) */
@media (min-width: 1400px) {
  :root {
    --container-max-width: 1320px;
  }

  .hero-title {
    font-size: var(--text-6xl);
  }

  .hero-subtitle {
    font-size: var(--text-3xl);
  }

  .section-title {
    font-size: var(--text-5xl);
  }

  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-8);
  }
}

/* LG Devices - Desktops (992px - 1399px) */
@media (max-width: 1399px) {
  :root {
    --container-max-width: 1140px;
  }

  .hero-title {
    font-size: var(--text-5xl);
  }

  .social-links-floating {
    left: 15px;
  }

  .tech-badge {
    transform: scale(0.9);
  }
}

/* MD Devices - Tablets y laptops pequeñas (768px - 991px) */
@media (max-width: 991px) {
  :root {
    --container-max-width: 960px;
    --container-padding: 1.25rem;
  }

  /* Header Mobile */
  .header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding-right: 60px;
  }

  .logo {
    display: flex;
    align-items: center;
    max-width: calc(100% - 80px);
  }

  .logo-text {
    font-size: var(--text-xl);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo svg {
    width: 30px;
    height: 30px;
    margin-right: var(--spacing-2);
  }

  .navbar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: rgba(0, 19, 51, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-12);
    transition: right var(--transition-normal) var(--transition-ease);
    z-index: var(--z-40);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    padding: var(--spacing-8);
    border-left: 1px solid rgba(1, 164, 247, 0.1);
  }

  .light-mode .navbar {
    background-color: rgba(248, 250, 252, 0.95);
  }

  .navbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(1, 211, 210, 0.05) 0%, transparent 30%),
      radial-gradient(circle at 80% 80%, rgba(157, 107, 238, 0.05) 0%, transparent 30%);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
  }

  .navbar.active {
    right: 0;
    animation: slideInMenu 0.5s forwards;
  }

  @keyframes slideInMenu {
    from { right: -100%; }
    to { right: 0; }
  }

  .navbar-list {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-6);
    width: 100%;
  }

  .navbar-link {
    font-size: var(--text-xl);
    display: inline-block;
    padding: var(--spacing-3) var(--spacing-4);
    border-radius: var(--rounded-md);
    transition: all 0.3s ease;
    width: 100%;
  }

  .navbar-link::after {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
  }

  .navbar-link:hover,
  .navbar-link.active {
    background-color: rgba(1, 164, 247, 0.1);
    color: var(--color-cyan-600);
    transform: translateY(-2px);
  }

  .navbar-link:hover::after,
  .navbar-link.active::after {
    width: 50%;
  }

  .header-right {
    flex-direction: column;
    gap: var(--spacing-6);
    width: 100%;
  }

  .auth-buttons {
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-4);
  }

  .btn-login,
  .btn-register {
    width: 100%;
    padding: var(--spacing-3) 0;
    text-align: center;
  }

  .theme-toggle {
    position: absolute;
    padding: 20px;
    font-size: 16px;
    top: -10px;
    left: 20px;
  }

  .nav-toggle {
    display: flex;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 42;
    width: 30px;
    height: 21px;
  }

  /* Hero */
  .hero {
    padding-top: 120px;
    padding-bottom: var(--spacing-12);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-subtitle {
    font-size: var(--text-xl);
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--spacing-8);
  }

  .hero-text {
    order: 2;
  }

  .hero-image {
    order: 1;
    margin-bottom: var(--spacing-6);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-title::after,
  .stat-item::after,
  .about-heading::after,
  .contact-heading::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .hero-cta,
  .hero-stats,
  .about-cta {
    justify-content: center;
  }

  .social-links-floating {
    display: none;
  }

  /* About */
  .about-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-10);
  }

  .about-image {
    margin: 0 auto;
    max-width: 350px;
  }

  .about-content,
  .about-heading,
  .about-text,
  .contact-heading,
  .contact-description {
    text-align: center;
  }

  .about-stats {
    margin: 0 auto var(--spacing-8);
    max-width: 600px;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  /* Community */
  .community-cta {
    flex-direction: column;
    gap: var(--spacing-6);
    text-align: center;
    padding: var(--spacing-6);
  }

  .cta-content p {
    margin: 0 auto;
  }

  .join-community-btn {
    width: 100%;
  }

  /* Contact */
  .contact-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-8);
  }

  .contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--spacing-8);
  }

  /* Footer */
  .footer-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-8);
  }

  .footer-info {
    max-width: 100%;
    text-align: center;
    margin: 0 auto;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-links-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-newsletter h3::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* SM Devices - Tablets pequeñas y móviles grandes (576px - 767px) */
@media (max-width: 767px) {
  :root {
    --container-max-width: 540px;
    --container-padding: 1rem;
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
  }

  .section {
    padding-top: var(--spacing-16);
    padding-bottom: var(--spacing-16);
  }

  .hero {
    padding-top: 100px;
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  .hero-description {
    font-size: var(--text-base);
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--spacing-6);
  }

  .stat-item {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-4);
  }

  .stat-item::after {
    display: none;
  }

  .hero-image {
    max-width: 320px;
  }

  .tech-badge {
    transform: scale(0.8);
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .about-cta {
    flex-direction: column;
    width: 100%;
  }

  .about-cta .btn {
    width: 100%;
  }

  .projects-header {
    flex-direction: column;
    align-items: stretch;
  }

  .projects-search {
    max-width: 100%;
  }

  .filter-container {
    justify-content: center;
    gap: var(--spacing-2);
  }

  .filter-btn {
    font-size: var(--text-xs);
    padding: var(--spacing-1) var(--spacing-3);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .community-cards {
    grid-template-columns: 1fr;
  }

  .contact-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

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

  .contact-form {
    padding: var(--spacing-6) var(--spacing-4);
  }

  .footer-bottom .container {
    flex-direction: column;
    gap: var(--spacing-4);
    text-align: center;
  }

  .footer-bottom-links {
    flex-direction: column;
    gap: var(--spacing-3);
  }

  .footer-links-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-title::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-link {
    padding-left: 0;
  }

  .footer-link::before {
    display: none;
  }

  .footer-contact-item {
    justify-content: center;
  }

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

/* XS Devices - Móviles (hasta 575px) */
@media (max-width: 575px) {
  :root {
    --container-max-width: 100%;
    --container-padding: 1rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }

  .logo-text {
    font-size: var(--text-lg);
  }

  .logo svg {
    width: 26px;
    height: 26px;
  }

  .header {
    padding: var(--spacing-3) 0;
  }

  .hero {
    padding-top: 90px;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .section-subtitle {
    font-size: var(--text-base);
  }

  .about-heading {
    font-size: var(--text-xl);
  }

  .experience-badge {
    width: 90px;
    height: 90px;
    right: -15px;
    bottom: -15px;
  }

  .experience-years {
    font-size: var(--text-2xl);
  }

  .experience-text {
    font-size: 0.7rem;
  }

  .service-card {
    height: 400px;
  }

  .service-front-content {
    padding: var(--spacing-4);
  }

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

  .service-icon i {
    font-size: 2rem;
  }

  .service-title {
    font-size: var(--text-lg);
  }

  .service-back-content {
    padding: var(--spacing-5);
  }

  .service-btn {
    padding: var(--spacing-2) var(--spacing-4);
    font-size: var(--text-xs);
  }

  .back-top-btn {
    width: 40px;
    height: 40px;
    right: 15px;
    bottom: 15px;
  }

  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .pagination-btn {
    width: 35px;
    height: 35px;
  }
}

/* Móviles muy pequeños (hasta 380px) */
@media (max-width: 380px) {
  .logo-text {
    font-size: 1.2rem;
  }

  .logo svg {
    width: 28px;
    height: 28px;
  }

  .experience-badge {
    width: 80px;
    height: 80px;
  }

  .experience-years {
    font-size: var(--text-xl);
  }
}

/* Landscape modes para móviles */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding-top: 80px;
    min-height: auto;
  }

  .navbar {
    overflow-y: auto;
    justify-content: flex-start;
    padding-top: 70px;
  }

  .modal {
    height: 90vh;
    overflow-y: auto;
  }
}

/* Mobile Overlay */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 19, 51, 0.85);
  backdrop-filter: blur(10px);
  z-index: var(--z-30);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}