body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Add media query for small screens */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 0px;
    }
    
    body {
        padding: 0;
    }
}

h1 {
    text-align: center;
    color: #333;
}

/* Tabs styling */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    background-color: #f1f1f1;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    transition: 0.3s;
}

.tab-btn:hover {
    background-color: #ddd;
}

.tab-btn.active {
    background-color: #4CAF50;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Existing styles */
/* Video wrapper to contain both video and overlay */
.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Face overlay styles */
#face-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: none;
    pointer-events: none; /* Allow clicks to pass through */
    overflow: hidden;
}

#face-oval {
    position: absolute;
    top: 60%;
    left: 50%;
    width: min(35vw, 35vh);
    height: min(35vw, 35vh);
/*    min-width: 250px;
    min-height: 250px;
    max-width: 550px;
    max-height: 550px;
*/    border: 0px solid #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    /* Hide the oval border and overlay - only segments will be visible */
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    /* Box-shadow trick to create the overlay effect around the oval */
    /* box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.9); */
    background: transparent; /* Make the oval area clear */
}

/* New styles for the segments */
#oval-segments {
    position: absolute;
    top: 60%;
    left: 50%;
    width: min(35vw, 35vh);
    height: min(35vw, 35vh);
/*    min-width: 250px;
    min-height: 250px;
    max-width: 550px;
    max-height: 550px;
*/    
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 11;
}

/* Media query for mobile devices to make oval face container occupy 75% of max width/height */
@media (max-width: 768px) {
    #face-oval, #oval-segments {
        width: min(75vw, 75vh);
        height: min(75vw, 75vh);
/*        min-width: unset;
        min-height: unset;
        max-width: min(85vw, 85vh);
        max-height: min(85vw, 85vh);
*/    
    }
}

/* Modify .segment - remove border and clip-path from here */
.segment {
    position: absolute;
    width: 100%; /* Full width/height of the container */
    height: 100%;
    /* No border or clip-path directly on the segment div */
}

/* Add styles for the pseudo-element */
.segment::before {
    content: '';
    position: absolute;
    top: -1px; /* Adjust by -1px to overlap with the circle border */
    left: -1px; /* Adjust by -1px to overlap with the circle border */
    width: calc(100% + 2px); /* Increase width to compensate for the negative positioning */
    height: calc(100% + 2px); /* Increase height to compensate for the negative positioning */
    border: 6px solid transparent; /* Make default border transparent */
    border-radius: 5px; /* Add 2px rounding to segment corners */
    box-sizing: border-box;
    clip-path: polygon(50% 50%, 0% 0%, 0% 0%); /* Default hidden clip-path */
    transition: border-color 0.3s ease; /* Smooth transition for color change */
}


/* Apply adjusted clip-path definitions to the pseudo-element */
/* Trying wider/adjusted points */
.segment-up::before {         clip-path: polygon(50% 50%, 25% 0%, 75% 0%); }
.segment-up-right::before {   clip-path: polygon(50% 50%, 75% 0%, 100% 25%); }
.segment-right::before {      clip-path: polygon(50% 50%, 100% 25%, 100% 75%); }
.segment-down-right::before { clip-path: polygon(50% 50%, 100% 75%, 75% 100%); }
.segment-down::before {       clip-path: polygon(50% 50%, 75% 100%, 25% 100%); }
.segment-down-left::before {  clip-path: polygon(50% 50%, 25% 100%, 0% 75%); }
.segment-left::before {       clip-path: polygon(50% 50%, 0% 75%, 0% 25%); }
.segment-up-left::before {    clip-path: polygon(50% 50%, 0% 25%, 25% 0%); }

/* Active state - change border color of the pseudo-element */
.segment.active::before {
    border-color: #ff4643; /* Green color */
}

/* REMOVE any duplicated .segment-* and .segment.active rules below this point */

/* Apply main-container styling to camera-container */
.camera-container {
    position: relative; /* Needed for absolute positioning of overlay */
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 0px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Add media query for small screens - same as container */
@media (max-width: 768px) {
    .camera-container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 0px;
    }
}

#video, #movement-video {
    width: 100%;
    border: 0px solid #ddd;
    border-radius: 4px;
    display: block;
    transform: scaleX(-1); /* Add this line to flip the video horizontally */
}

/* Center the button container */
.button-container {
    display: flex;
    justify-content: center;
    margin: 15px auto;
    width: 100%;
}

.button-container button {
    margin: 0 5px;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.result-container, .movement-result-container {
    margin-top: 20px;
}

/* Keep .success and .failure if used by movement verification */
.success {
    color: #4CAF50;
    font-weight: bold;
}

.failure {
    color: #f44336;
    font-weight: bold;
}

/* Keep Movement verification specific styles */
.instruction-container {
    margin: 15px 0;
    padding: 15px;
    height: 250px;
    background-color: #e8f5e9;
    border-radius: 4px;
    border-left: 5px solid #4CAF50;
}

#instruction-text {
    font-size: 18px;
    font-weight: bold;
}

#movement-progress {
    margin-top: 10px;
    height: 40px;
    background-color: #ddd;
    border-radius: 5px;
    overflow: hidden;
}

#movement-progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

.movement-indicator {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin: 0 5px;
    border-radius: 50%;
    background-color: #ddd;
    text-align: center;
    line-height: 40px;
    font-weight: bold;
}

.movement-indicator.completed {
    background-color: #4CAF50;
    color: white;
}

.movement-indicator.current {
    background-color: #2196F3;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.faces-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.face-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 2px solid #4CAF50;
    border-radius: 4px;
}

.face-image-container {
    text-align: center;
}

.face-image-label {
    font-size: 12px;
    margin-top: 5px;
    color: #555;
}

/* Countdown overlay styles */
#countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 15; /* Above the oval segments */
}

#countdown-number {
    font-size: 120px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    animation: pulse 1s infinite;
}

/* Circle indicator styling */
.direction-circle {
    display: flex; /* Hide by default, will be shown after countdown */
    justify-content: center;
    align-items: center;
    position: relative;
    width: 30px;
    height: 30px;
    z-index: 12;
}

.circle-indicator {
    width: 100%;
    height: 100%;
    background-color: #4CAF50;
    border-radius: 50%;
    animation: pulse-circle 1.5s infinite;
    position: relative;
}

/* Add pulse animation for circles */
@keyframes pulse-circle {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}




/* Circle indicator styling */
.direction-circle {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    z-index: 12;
}

/* Circle indicator styling - consolidated definition */
.circle-indicator {
    width: 30px;
    height: 30px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Active state for circles */
.direction-circle.active .circle-indicator {
    background-color: #4CAF50; /* Green when active */
}

/* Position the circles outside the oval border */

#circle-up {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
}

#circle-right {
    top: 50%;
    right: 15%;
    transform: translateY(-50%);
}

#circle-down {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
}

#circle-left {
    top: 50%;
    left: 15%;
    transform: translateY(-50%);
}

#circle-up-left {
    top: 15%;
    left: 25%;
}

#circle-up-right {
    top: 15%;
    right: 25%;
}

#circle-down-left {
    bottom: 15%;
    left: 25%;
}

#circle-down-right {
    bottom: 15%;
    right: 25%;
}



/* Success checkmark styling */
#success-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    color: #4CAF50;
    font-size: 120px;
    font-weight: bold;
    z-index: 15; /* Same or higher than countdown overlay */
}

/* Audio toggle styling */
.audio-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.audio-toggle-container input[type="checkbox"] {
    margin-right: 8px;
}

.audio-toggle-container label {
    font-size: 14px;
    color: #555;
}

/* Loading spinner overlay */
.loading-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--spinner-bg-color, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner-overlay.active {
    display: flex;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.rotating-wheels {
    position: relative;
    width: 120px;
    height: 120px;
}

.wheel {
    position: absolute;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.wheel-1 {
    width: 120px;
    height: 120px;
    top: 0;
    left: 0;
}

.wheel-2 {
    width: 80px;
    height: 80px;
    top: 20px;
    left: 20px;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.wheel-3 {
    width: 40px;
    height: 40px;
    top: 40px;
    left: 40px;
    animation-duration: 0.8s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive design for mobile devices */
@media (max-width: 768px) {
    .rotating-wheels {
        width: 100px;
        height: 100px;
    }
    
    .wheel-1 {
        width: 100px;
        height: 100px;
    }
    
    .wheel-2 {
        width: 70px;
        height: 70px;
        top: 15px;
        left: 15px;
    }
    
    .wheel-3 {
        width: 35px;
        height: 35px;
        top: 32.5px;
        left: 32.5px;
    }
    
    .spinner-text {
        font-size: 16px;
    }
}


