:root {
    --primary-dark: #0a192f;
    --secondary-dark: #112240;
    --accent-blue: #64ffda;
    --text-primary: #e6f1ff;
    --text-secondary: #a1bbe4;
    --button-primary: #1565c0;
    --button-hover: #1976d2;
    --glass-bg: rgba(16, 25, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

body {
    background: var(--primary-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.main-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.camera-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#output-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror the video feed */
}

/* Status overlay */
.status-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 25, 47, 0.7);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 16px;
    text-align: center;
    color: var(--accent-blue);
    z-index: 20;
    max-width: 90%;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.status-display.highlight {
    background: rgba(100, 255, 218, 0.2);
}

/* Toggle Panel Button */
.toggle-panel-btn {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 25, 40, 0.8);
    border: none;
    color: var(--accent-blue);
    width: 60px;
    height: 30px;
    border-radius: 10px 10px 0 0;
    z-index: 100;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--glass-border);
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.toggle-panel-btn:hover {
    background: rgba(100, 255, 218, 0.1);
    height: 35px;
}

.toggle-panel-btn .chevron {
    transition: transform 0.3s ease;
}

.toggle-panel-btn.active .chevron {
    transform: rotate(180deg);
}

/* Glass Effect Styling */
.glass-panel {
    background: rgba(16, 25, 40, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 16px;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 60vh;
    overflow-y: auto;
}

.glass-panel.active {
    transform: translateY(0);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.control-section {
    margin: 0;
    padding: 16px;
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 16px;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-item input {
    accent-color: var(--accent-blue);
}

.tools-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.button {
    background: linear-gradient(135deg, var(--button-primary) 0%, #0d47a1 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.button:hover {
    background: linear-gradient(135deg, var(--button-hover) 0%, #1565c0 100%);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.color-button {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-button.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue), 0 0 12px 2px rgba(100, 255, 218, 0.6);
    transform: scale(1.1);
}

.color-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.slider-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #0a1929, var(--accent-blue));
    border-radius: 3px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(100, 255, 218, 0.8);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(100, 255, 218, 0.8);
}

.guide-list {
    list-style-type: none;
}

.guide-item {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-item::before {
    content: "•";
    color: var(--accent-blue);
    font-size: 18px;
}

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

.ad-popup.show {
    opacity: 1;
    visibility: visible;
}

.ad-content {
    width: 320px;
    max-height: 100vh;
    padding: 20px;
    text-align: center;
    position: relative;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.7) 0%, rgba(10, 25, 47, 0.7) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.ad-title {
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(135deg, #64ffda 20%, #48a9fe 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 15px;
    margin-bottom: 10px;
}

.ad-tagline {
    font-size: 16px;
    margin-bottom: 5px;
    text-align: center;
    color: var(--text-secondary);
}

.ad-des{
    font-size: 12px;
    text-align: justify;
    margin-bottom: 5px;
}

.ad-link {
    color: var(--accent-blue);
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 0px;
    font-weight: 500;
    padding-bottom: 10px;
}

.qr-code {
    width: 180px;
    height: 180px;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 10px;
}

.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.learn-more-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
}

.learn-more-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Responsive design */
@media (max-width: 1200px) {
    .control-section {
        min-width: calc(50% - 16px);
        flex-basis: calc(50% - 16px);
    }
}

@media (max-width: 768px) {
    .control-section {
        min-width: 100%;
        flex-basis: 100%;
    }
    
    .ad-content {
        width: 90%;
        max-width: 320px;
    }
    
    .qr-code {
        width: 150px;
        height: 150px;
    }
    
    .glass-panel {
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .control-panel {
        padding: 12px 8px;
    }
    
    .control-section {
        padding: 12px;
        min-width: 100%;
    }
    
    .button {
        padding: 6px 12px;
    }
    
    .status-display {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* For devices in landscape orientation with small height */
@media (max-height: 500px) and (orientation: landscape) {
    .glass-panel {
        max-height: 80vh;
    }
    
    .control-section {
        min-width: calc(33% - 16px);
        flex-basis: calc(33% - 16px);
    }
}
