/* Large Desktop (1152px) */
@media (max-width: 1152px) {
  .preview-container {
    width: 95vw;
    margin: 0 auto;
  }
}

/* Desktop (1028px) */
@media (max-width: 1028px) {
  #videoContainer {
    max-width: 87%;
    margin-top: -3vh;
    padding: 0 2rem;
  }

  .video-container {
    height: 550px;
  }

  .playlist-panel {
    width: 250px;
  }
}

/* Tablet (768px) */
@media (max-width: 768px) {
  /* Calendar */
  .calendar {
    width: 53%;
    transform: translateX(50%);
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(25px, 1fr));
    gap: 0.2rem;
  }

  .calendar-day {
    font-size: 0.7rem;
  }

  /* Start Menu */
  .start-menu {
    width: 90%;
    transform: translateX(-100%);
  }

  .start-menu.show {
    transform: translateX(0);
  }

  .apps-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 5rem;
  }

  .app-icon {
    width: 40px;
    height: 40px;
  }

  /* File Manager */
  .file-manager {
    width: 95vw;
  }

  .file-manager-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .files-grid.certificates-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
  }

  .file-item.certificate {
    padding: 0.8rem;
  }

  .file-item img {
    height: 150px;
  }

  .header-right {
    gap: 0.5rem;
  }

  .filter-dropdown {
    width: 150px;
    padding: 0.4rem;
    padding-right: 2rem;
    font-size: 0.8rem;
  }

  /* Item Details */
  .item-details {
    padding: 0.75rem;
  }

  .item-details .description {
    font-size: 0.8rem;
  }

  .item-details .issuer,
  .item-details .date {
    font-size: 0.7rem;
  }

  .item-details .view-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  /* Tech Stack */
  .tech-stack i {
    font-size: 1.7rem;
  }

  /* Desktop Apps */
  .desktop-apps-container {
    margin-top: 4rem;
  }

  .desktop-apps-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.2rem;
    max-width: 350px;
  }

  .desktop-app span {
    font-size: 0.7rem;
    max-width: 70px;
  }

  /* Not Found Message */
  .not-found-message {
    padding: 0.3rem;
  }

  .not-found-message i {
    font-size: 1.5rem;
  }

  .not-found-message p {
    font-size: 0.7rem;
  }

  /* Search Results */
  .search-results .apps-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 5rem;
  }

  .search-results .app-icon {
    width: 40px;
    height: 40px;
  }

  /* Video Container */
  #videoContainer {
    max-width: 90%;
    margin-top: -2vh;
    padding: 0 1rem;
  }

  .video-container {
    height: 500px;
  }

  /* Preview */
  .preview-container {
    width: 94vw;
    margin: 0 auto;
  }

  .preview-content {
    padding: 1rem;
  }

  .preview-nav {
    width: 35px;
    height: 35px;
  }

  .preview-title {
    text-align: center;
  }

  .preview-info p {
    font-size: 0.8rem;
  }

  /* Project */
  .file-item.project {
    padding: 0.8rem;
  }

  .item-details {
    padding: 1rem;
  }

  /* Video Content */
  .video-content-wrapper {
    flex-direction: column;
  }

  .playlist-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 200px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
  }

  .playlist-panel.hidden {
    height: 0;
    max-height: 0;
  }

  .playlist-header {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
  }

  .playlist-items {
    height: 150px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding: 1rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .playlist-items::-webkit-scrollbar {
    display: none;
  }

  .playlist-item {
    flex: 0 0 280px;
    scroll-snap-align: start;
    flex-direction: row;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 0;
    width: 280px;
  }

  .playlist-item img {
    width: 120px;
    height: 68px;
    flex-shrink: 0;
  }

  .playlist-item-info {
    padding: 0 0.5rem;
    width: calc(100% - 120px);
  }

  .playlist-item-info h4 {
    font-size: 0.85rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
  }

  .playlist-item-info p {
    font-size: 0.75rem;
    opacity: 0.8;
  }

  /* Light Mode Overrides */
  body.light-mode .playlist-panel {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  body.light-mode .playlist-header {
    background: rgba(0, 0, 0, 0.05);
  }

  body.light-mode .playlist-item {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
  }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  /* Calendar */
  .calendar {
    width: 83%;
    transform: translateX(50%);
    padding: 0.8rem;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(25px, 1fr));
    gap: 0.2rem;
  }

  .calendar-day {
    font-size: 0.7rem;
    padding: 0.2rem;
  }

  .calendar-day.today {
    font-weight: bold;
  }

  /* Start Menu */
  .start-menu {
    width: 95%;
    padding: 0.8rem;
  }

  .apps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-bottom: 3rem;
  }

  .app-icon {
    width: 35px;
    height: 35px;
  }

  .app-name {
    font-size: 0.7rem;
  }

  .search-box {
    padding: 0.5rem;
    margin-bottom: 1rem;
  }

  /* File Manager */
  .files-grid.certificates-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.8rem;
  }

  .file-item img {
    height: 200px;
  }

  .file-manager-header {
    flex-direction: row;
    gap: 0.8rem;
    align-items: center;
    padding: 0.8rem;
  }

  .header-left {
    flex: 1;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .filter-dropdown {
    width: 140px;
    font-size: 0.75rem;
    padding: 0.3rem 1.5rem 0.3rem 0.3rem;
  }

  /* Item Details */
  .item-details {
    padding: 0.5rem;
  }

  .item-details .description {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .item-details .issuer,
  .item-details .date {
    font-size: 0.65rem;
  }

  .item-details .view-link {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    margin-top: 0.25rem;
  }

  /* Tech Stack */
  .tech-stack i {
    font-size: 1.5rem;
  }

  /* Desktop Apps */
  .desktop-apps-container {
    margin-top: 3rem;
  }

  .desktop-apps-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.2rem;
    max-width: 350px;
  }

  .desktop-app span {
    font-size: 0.7rem;
    max-width: 70px;
  }

  /* Not Found Message */
  .not-found-message {
    padding: 0.2rem;
  }

  .not-found-message i {
    font-size: 1.5rem;
  }

  .not-found-message p {
    font-size: 0.75rem;
  }

  /* Search Results */
  .search-results .apps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-bottom: 3rem;
  }

  .search-results .app-icon {
    width: 35px;
    height: 35px;
  }

  .search-results .app-name {
    font-size: 0.7rem;
  }

  /* Video Container */
  #videoContainer {
    max-width: 95%;
    margin-top: -1vh;
    padding: 0 1rem;
  }

  .video-container {
    height: 500px;
  }

  /* Preview */
  .preview-container {
    width: 93vw;
  }

  .preview-content {
    padding: 0.5rem;
    min-height: 300px;
  }

  .preview-nav {
    width: 30px;
    height: 30px;
  }

  .preview-title {
    text-align: left;
  }

  .preview-info p {
    font-size: 0.75rem;
  }

  /* Project */
  .file-item.project .file-name {
    font-size: 0.9rem;
  }

  .item-details {
    padding: 0.8rem;
  }

  /* Playlist */
  .playlist-panel {
    max-height: 180px;
  }

  .playlist-items {
    height: 130px;
  }

  .playlist-item {
    flex: 0 0 250px;
    width: 250px;
  }

  .playlist-item img {
    width: 100px;
    height: 56px;
  }

  .playlist-item-info {
    width: calc(100% - 100px);
  }

  .playlist-item-info h4 {
    font-size: 0.8rem;
  }

  .playlist-item-info p {
    font-size: 0.7rem;
  }
}

/* Small Mobile (320px) */
@media (max-width: 320px) {
  /* Calendar */
  .calendar {
    width: 95%;
    transform: translateX(50%);
    padding: 0.6rem;
  }

  .calendar-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 0.1rem;
  }

  .calendar-day {
    font-size: 0.6rem;
    padding: 0.1rem;
  }

  /* Start Menu */
  .start-menu {
    padding: 0.6rem;
  }

  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
    margin-bottom: 2rem;
  }

  .app-icon {
    width: 30px;
    height: 30px;
  }

  .app-name {
    font-size: 0.65rem;
  }

  .search-box {
    padding: 0.4rem;
    margin-bottom: 0.8rem;
  }

  .section-title h2 {
    font-size: 0.9rem;
  }

  /* Filter */
  .filter-dropdown {
    width: 130px;
    font-size: 0.7rem;
    padding: 0.25rem 1.2rem 0.25rem 0.25rem;
  }

  /* Item Details */
  .item-details {
    padding: 0.6rem;
  }

  .item-details .description {
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
  }

  .item-details .issuer,
  .item-details .date {
    font-size: 0.55rem;
  }

  .item-details .view-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    margin-top: 0.25rem;
  }

  /* Video Container */
  #videoContainer {
    max-width: 98%;
    margin-top: 0;
    padding: 0 1rem;
  }

  .video-container {
    height: 500px;
  }
}
