/* ==============================
   Base Styles
============================== */
body {
    margin: 0;
    padding: 0;
    background-color: #000;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Three.js Canvas Styles */
#container canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: block;
}

/* ==============================
   Header Styles
============================== */
#mainHeader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 255, 191, 0.2);
    border: 2px solid #00ffbf09;
    border-radius: 0 8px 0 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 200;
    backdrop-filter: blur(2px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 40px;
    width: auto;
}

.title {
    color: rgb(0, 255, 193);
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    background: rgba(0, 255, 191, 0);
    color: #00ffc1;
    box-shadow: 0 -5px 5px rgba(0, 0, 0, 0.5);
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    align-self: flex-end; /* Position buttons at the bottom of the navbar */
    text-decoration: none; /* Remove underline from links */
    border: none; /* Remove border from buttons/links */
}

.project-description{
    color: rgb(0, 255, 193);
    font-weight: bold;
}

.nav-btn:hover {
    background:  transparent;
    transform: translateY(-1px);
    box-shadow: 0 -5px 5px rgba(255, 0, 255, 0.9);
}

.nav-btn span {
    font-size: 16px;
}

/* ==============================
   Buttons
============================== */
button {
    background: #444;
    color: white;
    border: none;
    padding: 8px 12px;
    margin: 2px;
    border-radius: 3px;
    cursor: pointer;
}

button:hover {
    background: #666;
}

#status {
    position: absolute;
    bottom: 0px;
    left: 0px;
    z-index: 100;
    padding: 10px;
    border-radius: 5px;
    color: white;
    font-size: 12px;
    background: rgba(0, 255, 191, 0.2);
    border: 2px solid #00ffbf09;
    border-radius: 0 8px 0 0;
}

.connected {
    color: rgb(0, 255, 193);
}

.disconnected {
    color: #f44336;
}

/* ==============================
   Floating Stream & List Windows
============================== */
.stream-window {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    background: rgba(0, 255, 191, 0.2);
    border: 2px solid #00ffbf09;
    border-radius: 0 8px 8px 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    user-select: none;
    padding-left: 0%;
}

.list-window {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: 0px;
    width: 300px;
    min-height: 70%;
    max-height: 70%;
    background: rgba(0, 255, 191, 0.2);
    border: 2px solid #00ffbf09;
    border-radius: 8px 0 0 8px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    user-select: none;
    padding-left: 0%;
}

.list-window h3 {
    margin: 0 0 15px 0;
    color: #00ffc1;
    text-align: center;
    font-size: 16px;
}

/* Pallet styling */
.pallet-container {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
}

.pallet-info h4 {
    margin: 0 0 8px 0;
    color: #00ffc1;
    font-size: 14px;
}

.measurements {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: #ccc;
    margin-bottom: 10px;
}

.pallet-visual {
    position: relative;
    margin: 0 auto;
    border: 2px solid #00ff00;
    background: transparent;
}

.pallet-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    box-sizing: border-box;
}

.pallet-slot {
    position: absolute;
    background: rgba(255, 0, 255, 0.3);
    border: 2px solid #ff00ff;
    box-sizing: border-box;
}

/* Scrollbar styling for list window */
.list-window::-webkit-scrollbar {
    width: 6px;
}

.list-window::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.list-window::-webkit-scrollbar-thumb {
    background: #00ffc1;
    border-radius: 3px;
}

/* ==============================
   Stream Content
============================== */
.stream-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stream-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stream-label {
    color: #00ffc1;
    font-size: 12px;
    font-weight: bold;
    text-align: left;
    padding-left: 5px;
}

#streamVideo, #depthStream {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    background: #222;
    border: 1px solid #333;
}

.stream-status {
    color: #00ffc1;
    padding: 20px;
    font-size: 14px;
    backdrop-filter: blur(2px);
}

.stream-status.connected {
    color: #00ff00;
}

.stream-status.error {
    color: #ff4444;
}

/* Hide window when collapsed */
.stream-window.collapsed .window-content {
    display: none;
}


.logo_container {
  display: none; /* hide by default */
}

@media (min-width: 1250px) { /* show only when viewport is >= 1024px */
  .logo_container {
    display: block;
    position: absolute;
    top: 20%;
    right: 20%;
  }
}

.stream-window.collapsed {
    width: auto;
    min-width: 150px;
}

/* ==============================
   Popup Styles
============================== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.popup-window {
    background: rgba(18, 18, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 0, 255, 0.3);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(255, 0, 255, 0.2);
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.popup-overlay.active .popup-window {
    transform: scale(1) translateY(0);
}

.popup-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 0, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 0, 255, 0.1);
    border-radius: 12px 12px 0 0;
}

.popup-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
}

.popup-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: rgba(255, 0, 255, 0.2);
    color: #ff00ff;
    transform: scale(1.1);
}

.popup-content {
    padding: 30px;
    color: #ffffff;
    line-height: 1.6;
}

.popup-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* ==============================
   Popup Window Scrollbar Styling
============================== */
.popup-window::-webkit-scrollbar {
    width: 8px;
}

.popup-window::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.popup-window::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff00ff, #ff0080);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.popup-window::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff40ff, #ff40a0);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

/* Firefox scrollbar styling */
.popup-window {
    scrollbar-width: thin;
    scrollbar-color: #ff00ff rgba(0, 0, 0, 0.3);
}

/* ==============================
   Skill Tags
============================== */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.skill-tag {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.2), rgba(255, 0, 255, 0.1));
    border: 1px solid rgba(255, 0, 255, 0.4);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.4), rgba(255, 0, 255, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 255, 0.3);
}

/* ==============================
   Experience & Projects
============================== */
.experience-item {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #ff00ff;
}

.experience-item h4 {
    margin: 0 0 8px 0;
    color: #ff00ff;
    font-size: 1.2rem;
}

.experience-item .date {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-style: italic;
}

.experience-item p:last-child {
    margin-bottom: 0;
}

/* ==============================
   Education Styles
============================== */
.education-item {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #ff00ff;
}

.education-item h4 {
    margin: 0 0 8px 0;
    color: #ff00ff;
    font-size: 1.2rem;
}

.education-item .date {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-style: italic;
}

.education-item p:last-child {
    margin-bottom: 0;
}

.certification {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 2px solid rgba(255, 0, 255, 0.5);
}

.certification p {
    margin: 0 0 8px 0;
    font-weight: 500;
}

.cert-link {
    color: #ff00ff !important;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 5px;
}

.cert-link:hover {
    color: #ff40ff !important;
    text-decoration: underline;
    transform: translateX(3px);
}

/* ==============================
   -------------------
   RESTORED OLD FLOATING WINDOWS & NAV
============================== */

/* --- Floating Windows System (Old Version) --- */
.floating-windows-container {
    position: fixed;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw;
    height: 85vh;
    z-index: 100;
    pointer-events: none;
}

.floating-window {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    /* backdrop-filter: blur(10px); */
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: all;
    overflow-y: auto;
    overflow-x: hidden;
}

.floating-window.entering-right,
.floating-window.entering-left {
    transition: none !important;
}

.floating-window.active {
    opacity: 1;
    transform: translateX(0);
}

.floating-window.exiting-left {
    opacity: 0;
    transform: translateX(-100%);
}

.floating-window.entering-right {
    opacity: 0;
    transform: translateX(100%);
}

.floating-window.entering-left {
    opacity: 0;
    transform: translateX(-100%);
}

.floating-window.exiting-right {
    opacity: 0;
    transform: translateX(100%);
}

/* --- Window Header (Old Version) --- */
.window-header {
    padding: 20px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.window-header h3 {
    color: #00ffc1;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #00ffc1;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 0, 100, 0.2);
    color: #ff0064;
}

/* --- Navigation Arrow Buttons (Old Version) --- */
.nav-buttons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 150;
    pointer-events: none;
}

.nav-arrow-btn {
    position: fixed;
    background: rgba(0, 255, 191, 0.2);
    border: 2px solid #00ffbf;
    color: #00ffc1;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    pointer-events: all;
    top: 50%;
    transform: translateY(-50%);
}

.nav-arrow-btn:hover {
    background: rgba(0, 255, 191, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 191, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-arrow-btn:disabled,
.nav-arrow-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-arrow-btn:disabled:hover,
.nav-arrow-btn.disabled:hover {
    background: rgba(0, 255, 191, 0.2);
    box-shadow: none;
    transform: translateY(-50%) scale(1);
}

#rotateLeft {
    left: 20px;
}

#rotateRight {
    right: 20px;
}

.image-container {
    position: relative;
    margin: 150px auto 0;
    max-width: 200px;
    max-height: 200px;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateY(0deg) translateX(-50%);
    transition: transform 0.7s;
    border-radius: 8px;
}

.image-container span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(400px);
    transition: transform 0.7s, filter 0.7s, opacity 0.7s;
    
    /* Make further images look blurred/faded */
    filter: blur(calc(var(--blur, 0px)));
    opacity: calc(var(--opacity, 1));
    border-radius: 8px;
}

.image-container span img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: block;
    border-radius: 8px;
}


.btn-container {
  position: relative;
  width: 80%;
}

.btn {
  position: absolute;
  bottom: -80px;
  background: crimson;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}

#prev {
  left: 20%;
}

#next {
  right: 20%;
}

/* ==============================
   Responsive Design
============================== */
@media (max-width: 768px) {
    .popup-window {
        width: 95%;
        max-height: 90vh;
    }

    .popup-header {
        padding: 15px 20px;
    }

    .popup-content {
        padding: 20px;
    }

    .stream-window, .list-window {
        width: 90%;
        min-height: 60%;
    }

    #mainHeader {
        padding: 0 10px;
    }
}

/* ==============================
   Floating Windows Scrollbar Styling
============================== */
.floating-window::-webkit-scrollbar {
    width: 8px;
}

.floating-window::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.floating-window::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00ffc1, #00ff80);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.floating-window::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #40ffda, #40ffa0);
    box-shadow: 0 0 10px rgba(0, 255, 193, 0.5);
}

/* Firefox scrollbar styling for floating windows */
.floating-window {
    scrollbar-width: thin;
    scrollbar-color: #00ffc1 rgba(0, 0, 0, 0.3);
}

/* Fix text color in floating windows */
.floating-window .experience-item p {
    color: #ffffff;
}

/* ==============================
   Mobile Warning Styles
============================== */
.mobile-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000, #1a0033);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.mobile-warning-content {
    color: #ffffff;
    max-width: 400px;
}

.mobile-warning h2 {
    color: #ff00ff;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.mobile-warning p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #cccccc;
}

.mobile-warning .highlight {
    color: #00ffc1;
    font-weight: bold;
}

.mobile-warning i {
    font-size: 4rem;
    color: #ff00ff;
    margin-bottom: 20px;
    display: block;
    text-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
}

/* ==============================
   Responsive Design - Mobile Detection
============================== */
@media (max-width: 1024px) {
    .mobile-warning {
        display: flex;
    }
    
    #container {
        display: none;
    }
    
    #mainHeader {
        display: none;
    }
    
    .nav-buttons {
        display: none;
    }
    
    .floating-windows-container {
        display: none;
    }
    
    .popup-overlay {
        display: none !important;
    }
}
