/* =============================================
   URTIM Akademi - Responsive Styles
   Mobile-first breakpoints
   ============================================= */

/* ---- Tablet & Below (max-width: 1024px) ---- */
@media (max-width: 1024px) {
  :root {
    --navbar-height: 64px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    text-align: center;
  }

  .hero-left {
    order: 1;
  }

  .hero-right {
    order: 2;
    display: flex;
    justify-content: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-scroll {
    display: none;
  }

  .auth-card {
    max-width: 450px;
  }

  /* Navbar */
  .navbar-links {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-lg);
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    z-index: var(--z-sticky);
  }

  .navbar-links.open {
    transform: translateX(0);
  }

  .nav-link {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-light);
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 var(--space-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }

  .nav-dropdown.open .nav-dropdown-menu {
    max-height: 200px;
  }

  .navbar-toggle {
    display: flex;
  }

  /* Sections */
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .journey-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl) var(--space-xl);
  }

  .journey-steps::before {
    display: none;
  }

  .trainings-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl) var(--space-xl);
  }

  .career-cta-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .career-cta-actions {
    justify-content: center;
  }

  .career-cta-visual {
    min-height: 250px;
  }

  .testimonials-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quick-access-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
    padding-right: 0;
  }

  /* Pages */
  .internship-layout {
    grid-template-columns: 1fr;
  }

  .internship-sidebar {
    position: static;
  }

  .trainings-features-grid,
  .recommended-grid,
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-search-input {
    width: 160px;
  }

  /* Profile layout */
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    display: flex;
    flex-direction: row;
    gap: var(--space-lg);
    align-items: start;
  }

  .profile-sidebar-card {
    min-width: 200px;
  }

  .profile-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .profile-nav-item {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Admin panel */
  .admin-sidebar {
    width: 220px;
  }

  .admin-main {
    margin-left: 220px;
    padding: var(--space-xl);
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-stats-grid--6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-grid-2 {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-toolbar-right {
    justify-content: flex-end;
  }

  /* Mega menu */
  .filter-dropdown-menu--mega {
    min-width: 320px;
    max-width: 380px;
  }

  /* Profile dropdown */
  .profile-dropdown-menu {
    width: 260px;
  }
}

/* ---- Mobile Large (max-width: 768px) ---- */
@media (max-width: 768px) {
  .section {
    padding: var(--space-3xl) 0;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .hero {
    min-height: auto;
    padding-top: var(--navbar-height);
    padding-bottom: var(--space-2xl);
  }

  .hero-content {
    padding: var(--space-2xl) var(--space-md);
  }

  .hero-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }

  .hero-stats {
    gap: var(--space-lg);
  }

  .hero-stat-value {
    font-size: 1.4rem;
  }

  .why-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .why-card {
    padding: var(--space-lg);
  }

  .journey-steps {
    grid-template-columns: 1fr 1fr;
  }

  .trainings-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .career-illustration {
    width: 200px;
    height: 200px;
  }

  .career-illustration i {
    font-size: 3.5rem;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .quick-access-grid {
    grid-template-columns: 1fr;
    margin-top: calc(-1 * var(--space-xl));
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .profile-features {
    grid-template-columns: 1fr;
  }

  .trainings-features-grid,
  .recommended-grid,
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar-left {
    flex-wrap: wrap;
  }

  .filter-search-input {
    width: 100%;
  }

  .filter-bar-right {
    text-align: right;
  }

  /* Profile on mobile */
  .profile-sidebar {
    flex-direction: column;
  }

  .profile-sidebar-card {
    min-width: unset;
  }

  .profile-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding-bottom: 4px;
  }

  .profile-nav-item {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .profile-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Admin on mobile */
  .admin-sidebar {
    position: fixed;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
    z-index: 100;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  /* Sidebar overlay when open */
  .admin-sidebar.open::after {
    content: "";
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
  }

  .admin-main {
    margin-left: 0;
    padding: var(--space-lg);
  }

  .admin-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
  }

  .admin-sidebar-close {
    display: block;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-stats-grid--6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-sidebar-toggle {
    display: flex;
  }

  .admin-grid-2 {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-toolbar-left,
  .admin-toolbar-right {
    flex-wrap: wrap;
  }

  .admin-search {
    min-width: unset;
    width: 100%;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .admin-tabs {
    flex-direction: column;
  }

  .admin-modal {
    max-height: 95vh;
  }

  .admin-modal--lg {
    max-width: 95%;
  }

  .admin-detail-grid {
    grid-template-columns: 1fr;
  }

  .admin-question-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  /* Mega menu on mobile */
  .filter-dropdown-menu--mega {
    min-width: 280px;
    max-width: 100vw;
  }

  .profile-dropdown-menu {
    width: 260px;
    right: -10px;
  }

  /* Modal */
  .modal {
    width: 95%;
    max-width: 440px;
  }

  .modal-header {
    padding: var(--space-xl) var(--space-lg) var(--space-md);
  }

  .modal-body {
    padding: var(--space-lg);
  }
}

/* ---- Mobile Small (max-width: 480px) ---- */
@media (max-width: 480px) {
  .hero-content {
    padding: var(--space-xl) var(--space-md);
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .hero-stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
  }

  .auth-card {
    padding: var(--space-lg);
  }

  .why-grid {
    grid-template-columns: 1fr;
  }

  .journey-steps {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .btn-lg {
    padding: 14px 24px;
    font-size: 0.95rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .modal-option {
    padding: var(--space-md);
  }

  .trainings-features-grid,
  .recommended-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .navbar-actions .btn-profile span {
    display: none;
  }

  .btn-profile-name,
  .btn-profile-arrow {
    display: none;
  }

  .profile-dropdown-menu {
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    left: auto;
    width: 280px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .lang-switcher button {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
}

/* ---- Desktop Large (min-width: 1440px) ---- */
@media (min-width: 1440px) {
  :root {
    --container-max: 1360px;
  }
}

/* ---- Admin Table Horizontal Scroll ---- */
@media (max-width: 1024px) {
  .admin-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table {
    min-width: 700px;
  }
}

@media (max-width: 768px) {
  .admin-table {
    min-width: 600px;
  }

  /* Tag selector responsive */
  .admin-tag-selector {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--space-sm);
  }

  .admin-tag-check {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  /* Form actions stacking */
  .admin-form-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .admin-form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* File upload area compact */
  .file-upload-area {
    min-height: 80px;
  }

  .file-upload-content i {
    font-size: 1.5rem;
  }

  /* Question cards */
  .admin-question-card-body .form-group textarea {
    font-size: 0.85rem;
  }

  /* Admin card body padding */
  .admin-card-body {
    padding: var(--space-md);
  }

  /* Stat cards */
  .admin-stat-card {
    padding: var(--space-sm) var(--space-md);
  }

  .admin-stat-val {
    font-size: 1.2rem;
  }

  /* Filter mega menu */
  .filter-dropdown-menu--mega .filter-group {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  /* Admin sidebar full width */
  .admin-sidebar {
    width: 100%;
  }

  .admin-main {
    padding: var(--space-md);
  }

  .admin-page-header h1 {
    font-size: 1.2rem;
  }

  .admin-page-desc {
    font-size: 0.8rem;
  }

  /* Admin table extra compact */
  .admin-table th,
  .admin-table td {
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .admin-actions {
    gap: 2px;
  }

  .admin-action-btn {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  /* Admin badge small */
  .admin-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  /* Video detail modal */
  .video-detail-player {
    min-height: 180px;
  }

  .video-detail-player iframe,
  .video-detail-player video {
    min-height: 180px;
  }

  .video-detail-body h2 {
    font-size: 1.1rem;
  }

  .video-detail-meta {
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: 0.8rem;
  }

  /* Exam container */
  .exam-container {
    padding: var(--space-md);
  }

  .exam-question h4 {
    font-size: 0.9rem;
  }

  .exam-option {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
  }

  /* Admin stats grid */
  .admin-stats-grid--6 {
    grid-template-columns: 1fr 1fr;
  }

  /* Admin nav labels truncate */
  .admin-nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Admin modal full-width on very small screens */
  .admin-modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
  }

  /* Reports stat card min-width */
  .admin-stat-card {
    min-width: 0;
  }

  /* Admin form groups stack */
  .admin-form-row {
    grid-template-columns: 1fr;
  }

  /* Internship form responsive */
  .internship-form-section {
    padding: var(--space-md);
  }

  .internship-form .form-row {
    grid-template-columns: 1fr;
  }
}
