canvas {
    font-family: 'Amiri', serif;
}

/* التنسيقات الجديدة */
body {
    background-color: #121212;
    color: #ffffff;
        overflow-x: hidden;

}

#controlPanel {
    background-color: rgba(30, 30, 30, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 95%;
}

.control-section {
    background-color: rgba(45, 45, 45, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

input,
select {
    background-color: rgba(70, 70, 70, 0.7) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 150, 255, 0.3);
}

#viewer {
    background: transparent;

}

.color-controls {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.preset-colors {
    margin-top: 15px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.color-box {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: transform 0.2s;
}

.color-box:hover {
    transform: scale(1.1);
    border-color: #999;
}

.color-box.selected {
    border-color: #000;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

input[type=range] {
    -webkit-appearance: none;
    /* إزالة الشكل الافتراضي */
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    background: #6366f1;
    /* لون البنفسجي */
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    margin-top: -7px;
    /* لتوسيطه على المسار */
}

input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    background: #6366f1;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
}



.user-profile-container {
    top: 1.5rem;
    left: 20rem; /* تباعد أكثر عن الشعار */
    right: auto;
}

/* تنسيق القائمة المنسدلة */
#userDropdown {
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

#userDropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#chevronIcon.rotate {
    transform: rotate(180deg);
}

/* أنماط مخصصة للريسبونسف */
#viewer-container {
    position: relative;
    width: 100%;
    height: 60vh;
}

#controlPanel {
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    #viewer-container {
        height: 100vh;
    }

    #controlPanel {
        position: fixed;
        top: 24px;
        right: 24px;
        width: 500px;
        max-height: calc(100vh - 48px);
    }

    .user-profile-container {
        top: 1.5rem;
        left: 20rem;
    }
}

/* Optional */
#mugMeasureTooltip { transition: 0.05s linear; white-space: nowrap; }



.coordinate-display {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  padding: 15px;
  margin: 15px 0;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.coordinate-display h3 {
  color: #ffd700;
  margin-bottom: 12px;
  font-size: 1.1rem;
  text-align: center;
}

.coordinate-item {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

.coord-label {
  font-weight: bold;
  color: #ffd700;
}

.coord-value {
  font-family: monospace;
  font-size: 1.1rem;
}

@media (max-width: 767px) {
    #controlPanel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 45vh;
        border-radius: 16px 16px 0 0;
        transform: none !important;
    }

    #togglePanel {
        display: none !important;
    }

    .user-profile-container {
        top: 1rem;
        left: 10rem;
        right: auto;
        max-width: calc(100% - 6rem);
    }

    #userDropdown {
        right: 0;
        left: auto;
    }
}

@media (max-width: 480px) {
    .user-profile-container {
        top: 0.75rem;
        left: 2rem;
        padding: 0.5rem;
        max-width: calc(100% - 5rem);
    }

    .user-profile-container span {
        font-size: 0.85rem;
    }

    #userDropdown {
        width: 42vw;
        right: 0;
        left: auto;
    }
}

/* تأكد من أن قائمة المستخدم فوق كل العناصر */
.user-profile-container,
#userDropdown {
    z-index: 9999;
}
