/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #673AB7;
    --primary-light: #9575CD;
    --primary-dark: #512DA8;
    --background-color: #F0EBF8;
    --card-background: #FFFFFF;
    --text-primary: #202124;
    --text-secondary: #5F6368;
    --border-color: #DADCE0;
    --error-color: #D93025;
    --success-color: #1E8E3E;
    --hover-bg: #F1F3F4;
    --focus-color: #1A73E8;
    --card-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --card-shadow-hover: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.video-background iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    min-height: 100vh;
    min-width: 177.78vh;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: filter 0.3s ease-out;
}

.video-background.blurred iframe {
    filter: var(--video-blur);
}

.video-overlay,
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--video-overlay-color);
    pointer-events: none;
    transition: background 0.3s ease-out;
}

/* Image Background */
.image-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    transition: filter 0.3s ease-out;
}

.image-background.blurred {
    filter: var(--image-blur);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: var(--card-blur, none);
    -webkit-backdrop-filter: var(--card-blur, none);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-text {
    font-family: 'Google Sans', sans-serif;
    font-size: 22px;
    color: var(--text-secondary);
}

.form-title-input {
    font-family: 'Google Sans', sans-serif;
    font-size: 18px;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    width: 300px;
    transition: background 0.2s;
}

.form-title-input:hover {
    background: var(--hover-bg);
}

.form-title-input:focus {
    outline: none;
    background: var(--hover-bg);
    border-bottom: 2px solid var(--primary-color);
}

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

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--hover-bg);
}

/* Tabs */
.tabs-container {
    background: var(--tabs-background, var(--card-background));
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    backdrop-filter: var(--tabs-blur, none);
    -webkit-backdrop-filter: var(--tabs-blur, none);
}

.tabs {
    display: flex;
    gap: 0;
}

.tab {
    padding: 16px 24px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.response-count {
    background: var(--text-secondary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 4px;
}

/* Main Content */
.main-content {
    max-width: 770px;
    margin: 0 auto;
    padding: 24px 16px;
}

.tab-content {
    display: none;
}

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

/* Cards */
.card {
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    margin-bottom: 12px;
    position: relative;
    transition: box-shadow 0.2s, border-color 0.2s;
    backdrop-filter: var(--card-blur, none);
    -webkit-backdrop-filter: var(--card-blur, none);
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-accent {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 8px 8px 0 0;
}

/* Form Header Card */
.form-header-card {
    padding: 24px;
    padding-top: 34px;
}

.form-title {
    width: 100%;
    border: none;
    font-size: 32px;
    font-family: 'Google Sans', sans-serif;
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid transparent;
}

.form-title:focus {
    outline: none;
    border-bottom: 2px solid var(--primary-color);
}

.form-description {
    width: 100%;
    border: none;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    border-bottom: 1px solid transparent;
}

.form-description:focus {
    outline: none;
    border-bottom: 2px solid var(--primary-color);
}

/* Question Card */
.question-card {
    padding: 24px;
    border-left: 6px solid transparent;
    transition: border-color 0.2s;
}

.question-card.active {
    border-left-color: var(--primary-color);
}

.question-card.selected {
    border-left-color: var(--focus-color);
}

.question-header {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.question-title {
    flex: 1;
    border: none;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    padding: 16px 0 8px;
    background: var(--hover-bg);
    padding-left: 12px;
}

.question-title:focus {
    outline: none;
    border-bottom: 2px solid var(--primary-color);
}

.question-type-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    min-width: 180px;
}

.question-type-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Question Body */
.question-body {
    padding: 8px 0;
}

/* Short Answer / Paragraph */
.short-answer-preview,
.paragraph-preview {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px dotted var(--border-color);
    max-width: 50%;
}

.paragraph-preview {
    max-width: 100%;
}

/* Options (Multiple Choice / Checkbox / Dropdown) */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.option-icon {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    flex-shrink: 0;
}

.option-icon.checkbox {
    border-radius: 3px;
}

.option-icon.dropdown {
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.option-input {
    flex: 1;
    border: none;
    border-bottom: 1px solid transparent;
    font-size: 14px;
    padding: 4px 0;
}

.option-input:focus {
    outline: none;
    border-bottom: 1px solid var(--primary-color);
}

.option-input:hover {
    border-bottom: 1px solid var(--border-color);
}

.remove-option-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.option-item:hover .remove-option-btn {
    opacity: 1;
}

.add-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    border: none;
    background: none;
}

.add-option-btn:hover {
    color: var(--text-primary);
}

/* Linear Scale */
.linear-scale-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
}

.scale-range {
    display: flex;
    align-items: center;
    gap: 16px;
}

.scale-range select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.scale-labels {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scale-label-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scale-label-input span {
    min-width: 20px;
    color: var(--text-secondary);
}

.scale-label-input input {
    flex: 1;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 4px 0;
    font-size: 14px;
}

/* Date / Time */
.date-preview,
.time-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    padding: 8px 0;
    border-bottom: 1px dotted var(--border-color);
    width: 200px;
}

/* File Upload */
.file-upload-preview {
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    padding: 32px;
    text-align: center;
    color: var(--text-secondary);
}

.file-upload-preview .material-icons {
    font-size: 48px;
    margin-bottom: 8px;
}

/* Question Footer */
.question-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    gap: 16px;
}

.question-actions {
    display: flex;
    gap: 4px;
}

.question-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 14px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #B0BEC5;
    transition: 0.3s;
    border-radius: 14px;
}

.toggle-slider::before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: -2px;
    bottom: -3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-slider {
    background-color: var(--primary-light);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background-color: var(--primary-color);
}

/* Floating Toolbar */
.floating-toolbar {
    position: fixed;
    top: 50%;
    right: calc(50% - 430px);
    transform: translateY(-50%);
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toolbar-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.toolbar-btn:hover {
    background: var(--hover-bg);
}

/* Side Panel - Isolated from theme changes */
.side-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 360px;
    height: 100%;
    background: #FFFFFF;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 200;
    transition: right 0.3s, background-color 0.3s, color 0.3s;
    color: #202124;
}

.side-panel.open {
    right: 0;
}

/* Dark mode for side panel */
.side-panel.dark-mode {
    background: #1E1E1E;
    color: #E8EAED;
}

.side-panel.dark-mode .panel-header {
    border-bottom-color: #3C4043;
}

.side-panel.dark-mode .theme-section {
    border-bottom-color: #3C4043;
}

.side-panel.dark-mode .theme-subsection {
    border-top-color: #3C4043;
}

.side-panel.dark-mode .theme-section h4,
.side-panel.dark-mode .subsection-header {
    color: #9AA0A6;
}

.side-panel.dark-mode .color-label,
.side-panel.dark-mode .slider-label {
    color: #E8EAED;
}

.side-panel.dark-mode .slider-value {
    color: #9AA0A6;
}

.side-panel.dark-mode .color-custom {
    background: #2D2D2D;
    border-color: #5F6368;
}

.side-panel.dark-mode .color-custom:hover {
    border-color: #8AB4F8;
    background: #3C4043;
}

.side-panel.dark-mode .color-custom .material-icons {
    color: #9AA0A6;
}

.side-panel.dark-mode .color-custom:hover .material-icons {
    color: #8AB4F8;
}

.side-panel.dark-mode .color-picker-btn {
    background: #2D2D2D;
    border-color: #5F6368;
}

.side-panel.dark-mode .color-picker-btn:hover {
    border-color: #8AB4F8;
    background: #3C4043;
}

.side-panel.dark-mode .color-picker-btn .material-icons {
    color: #9AA0A6;
}

.side-panel.dark-mode .color-picker-btn:hover .material-icons {
    color: #8AB4F8;
}

.side-panel.dark-mode .color-picker-btn.active {
    border-color: #8AB4F8;
    background: #8AB4F8;
}

.side-panel.dark-mode .color-picker-btn.active .material-icons {
    color: #1E1E1E;
}

.side-panel.dark-mode .theme-input {
    background: #2D2D2D;
    border-color: #5F6368;
    color: #E8EAED;
}

.side-panel.dark-mode .theme-input:focus {
    border-color: #8AB4F8;
}

.side-panel.dark-mode .theme-input::placeholder {
    color: #9AA0A6;
}

.side-panel.dark-mode .theme-slider {
    background: #5F6368;
}

.side-panel.dark-mode .theme-slider::-webkit-slider-thumb {
    background: #8AB4F8;
}

.side-panel.dark-mode .theme-slider::-moz-range-thumb {
    background: #8AB4F8;
}

.side-panel.dark-mode .theme-actions {
    border-top-color: #3C4043;
}

.side-panel.dark-mode .btn-secondary {
    color: #8AB4F8;
    border-color: #5F6368;
}

.side-panel.dark-mode .btn-secondary:hover {
    background: #3C4043;
}

.side-panel.dark-mode .icon-btn {
    color: #E8EAED;
}

.side-panel.dark-mode .icon-btn:hover {
    background: #3C4043;
}

.side-panel.dark-mode .color-swatch.selected {
    box-shadow: 0 0 0 2px #1E1E1E, 0 0 0 4px #E8EAED;
}

/* Panel Mode Toggle */
.panel-mode-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 8px;
}

.mode-toggle-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5F6368;
    transition: all 0.2s;
}

.mode-toggle-btn:hover {
    background: rgba(0,0,0,0.08);
}

.mode-toggle-btn.active {
    background: rgba(0,0,0,0.12);
    color: #202124;
}

.side-panel.dark-mode .mode-toggle-btn {
    color: #9AA0A6;
}

.side-panel.dark-mode .mode-toggle-btn:hover {
    background: rgba(255,255,255,0.08);
}

.side-panel.dark-mode .mode-toggle-btn.active {
    background: rgba(255,255,255,0.12);
    color: #E8EAED;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #DADCE0;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 500;
}

.panel-content {
    padding: 16px;
    overflow-y: auto;
    height: calc(100% - 60px);
}

.theme-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #DADCE0;
}

.theme-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.theme-section h4 {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #5F6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Color Row */
.color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.color-row:last-child {
    margin-bottom: 0;
}

.color-label {
    font-size: 13px;
    color: #202124;
    flex-shrink: 0;
}

.color-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    padding: 0;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.selected {
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #202124;
}

.color-custom {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px dashed #DADCE0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    padding: 0;
    transition: all 0.15s;
}

.color-custom:hover {
    border-color: #673AB7;
    background: #F1F3F4;
}

.color-custom .material-icons {
    font-size: 14px;
    color: #5F6368;
}

.color-custom:hover .material-icons {
    color: #673AB7;
}

.color-picker-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px dashed #DADCE0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    padding: 0;
    transition: all 0.15s;
}

.color-picker-btn:hover {
    border-color: #673AB7;
    background: #F1F3F4;
}

.color-picker-btn .material-icons {
    font-size: 14px;
    color: #5F6368;
}

.color-picker-btn:hover .material-icons {
    color: #673AB7;
}

.color-picker-btn.active {
    border-color: #673AB7;
    background: #673AB7;
}

.color-picker-btn.active .material-icons {
    color: #FFFFFF;
}

/* Color Clone/Eyedropper Tool */
.color-clone {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px dashed #DADCE0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    padding: 0;
    transition: all 0.15s;
}

.color-clone:hover {
    border-color: #4285F4;
    background: #E8F0FE;
}

.color-clone .material-icons {
    font-size: 14px;
    color: #5F6368;
}

.color-clone:hover .material-icons {
    color: #4285F4;
}

.side-panel.dark-mode .color-clone {
    background: #2D2D2D;
    border-color: #5F6368;
}

.side-panel.dark-mode .color-clone:hover {
    border-color: #8AB4F8;
    background: #3C4043;
}

.side-panel.dark-mode .color-clone .material-icons {
    color: #9AA0A6;
}

.side-panel.dark-mode .color-clone:hover .material-icons {
    color: #8AB4F8;
}

/* Color clone active mode */
body.color-clone-active {
    cursor: crosshair !important;
}

body.color-clone-active * {
    cursor: crosshair !important;
}

.color-clone-highlight {
    outline: 3px solid #4285F4 !important;
    outline-offset: 2px;
}

/* Theme Subsections */
.theme-subsection {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #DADCE0;
}

.subsection-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #5F6368;
    margin-bottom: 12px;
}

.subsection-header .material-icons {
    font-size: 16px;
}

/* Video Background Input */
.video-bg-input {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.theme-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #DADCE0;
    border-radius: 4px;
    font-size: 13px;
    background: #FFFFFF;
    color: #202124;
}

.theme-input:focus {
    outline: none;
    border-color: #673AB7;
}

.theme-input::placeholder {
    color: #9AA0A6;
}

.video-bg-controls {
    display: none;
}

.video-bg-controls.active,
.image-bg-controls.active {
    display: block;
}

/* Audio Controls */
.audio-controls-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #DADCE0;
}

.side-panel.dark-mode .audio-controls-section {
    border-top-color: #3C4043;
}

.audio-controls-section .slider-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-controls-section .slider-label .material-icons {
    font-size: 18px;
    color: #5F6368;
}

.side-panel.dark-mode .audio-controls-section .slider-label .material-icons {
    color: #9AA0A6;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.toggle-label {
    font-size: 13px;
    color: #202124;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

.custom-audio-input {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.custom-audio-input.hidden {
    display: none;
}

.custom-audio-input .theme-input {
    flex: 1;
}

/* Dark mode for toggle elements */
.side-panel.dark-mode .toggle-slider {
    background-color: #5F6368;
}

.side-panel.dark-mode .toggle-switch input:checked + .toggle-slider {
    background-color: #8AB4F8;
}

.side-panel.dark-mode .toggle-label {
    color: #E8EAED;
}

/* Volume Button Settings */
.volume-btn-settings {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #DADCE0;
}

.side-panel.dark-mode .volume-btn-settings {
    border-top-color: #3C4043;
}

.volume-btn-settings.hidden {
    display: none;
}

.border-settings.hidden {
    display: none;
}

.subsection-header {
    font-size: 12px;
    font-weight: 500;
    color: #5F6368;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.volume-btn-preview-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    min-height: 80px;
    /* See-through effect: same background as page with fixed attachment */
    background-color: var(--background-color);
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    /* Subtle inner shadow to show the "window" edges */
    box-shadow: inset 0 0 0 1px rgba(128,128,128,0.2);
}

.volume-btn-preview-wrap .preview-bg-layer {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    pointer-events: none;
    z-index: 0;
}

.volume-btn-preview-wrap .preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

/* For video background, we embed an iframe */
.volume-btn-preview-wrap .preview-video-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: 177.78vh;
    height: 56.25vw;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: none;
    z-index: 0;
}

.volume-control-preview {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    z-index: 2;
    height: 40px;
    position: relative;
    z-index: 1;
    width: 140px;
    overflow: hidden;
}

.volume-btn-preview {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}

.volume-btn-preview .material-icons {
    font-size: 22px;
}

.volume-slider-preview-wrap {
    flex: 1;
    padding-right: 12px;
    display: flex;
    align-items: center;
}

.volume-slider-preview {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    position: relative;
}

.volume-slider-thumb-preview {
    position: absolute;
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #FFFFFF;
    border-radius: 50%;
}

/* Background Type Toggle */
.bg-type-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #F1F3F4;
    border-radius: 8px;
    padding: 4px;
}

.side-panel.dark-mode .bg-type-toggle {
    background: #3C4043;
}

.bg-type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    color: #5F6368;
    transition: all 0.2s;
}

.bg-type-btn .material-icons {
    font-size: 20px;
}

.bg-type-btn:hover {
    background: rgba(0,0,0,0.05);
}

.bg-type-btn.active {
    background: #FFFFFF;
    color: #673AB7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.side-panel.dark-mode .bg-type-btn {
    color: #9AA0A6;
}

.side-panel.dark-mode .bg-type-btn:hover {
    background: rgba(255,255,255,0.05);
}

.side-panel.dark-mode .bg-type-btn.active {
    background: #5F6368;
    color: #E8EAED;
}

.bg-type-content {
    margin-top: 12px;
}

.bg-type-content.hidden {
    display: none;
}

/* Image Background Input */
.image-bg-input {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.image-bg-controls {
    display: none;
}

.image-preview {
    margin-bottom: 12px;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

/* Theme Select */
.theme-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #DADCE0;
    border-radius: 4px;
    font-size: 13px;
    background: #FFFFFF;
    color: #202124;
    cursor: pointer;
}

.theme-select:focus {
    outline: none;
    border-color: #673AB7;
}

.side-panel.dark-mode .theme-select {
    background: #2D2D2D;
    border-color: #5F6368;
    color: #E8EAED;
}

.side-panel.dark-mode .theme-select:focus {
    border-color: #8AB4F8;
}

.video-preview {
    margin-bottom: 12px;
    border-radius: 4px;
    overflow: hidden;
}

.video-preview img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Slider Row */
.slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.slider-row:last-child {
    margin-bottom: 0;
}

.slider-label {
    font-size: 12px;
    color: #202124;
    min-width: 100px;
}

.theme-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #DADCE0;
    border-radius: 2px;
    outline: none;
}

.theme-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #673AB7;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.theme-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #673AB7;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.slider-value {
    font-size: 11px;
    color: #5F6368;
    min-width: 35px;
    text-align: right;
}

/* Theme Actions */
.theme-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #DADCE0;
}

.theme-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Color Popover - Isolated from theme changes */
.color-popover {
    position: fixed;
    width: 320px;
    background: #FFFFFF;
    color: #202124;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: 1000;
    display: none;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

.color-popover.open {
    display: block;
    animation: popoverIn 0.2s ease-out;
}

.color-popover.open {
    transition: box-shadow 0.3s ease-out, background-color 0.3s, color 0.3s;
}

.color-popover.dragging {
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.8), 0 0 20px 4px rgba(66, 133, 244, 0.4), 0 12px 40px rgba(0,0,0,0.3);
}

/* Dark mode for color popover */
.color-popover.dark-mode {
    background: #1E1E1E;
    color: #E8EAED;
}

.color-popover.dark-mode .color-popover-header {
    border-bottom-color: #3C4043;
}

.color-popover.dark-mode .color-popover-footer {
    border-top-color: #3C4043;
    background: #2D2D2D;
}

.color-popover.dark-mode .color-value-row label {
    color: #9AA0A6;
}

.color-popover.dark-mode .hex-input-sm,
.color-popover.dark-mode .rgb-input-sm {
    background: #2D2D2D;
    border-color: #5F6368;
    color: #E8EAED;
}

.color-popover.dark-mode .hex-input-sm:focus,
.color-popover.dark-mode .rgb-input-sm:focus {
    border-color: #8AB4F8;
}

.color-popover.dark-mode .color-preview-large {
    border-color: #5F6368;
}

.color-popover.dark-mode .icon-btn {
    color: #E8EAED;
}

.color-popover.dark-mode .icon-btn:hover {
    background: #3C4043;
}

.color-popover.dark-mode .btn-text {
    color: #8AB4F8;
}

.color-popover.dark-mode .btn-text:hover {
    background: #3C4043;
}

@keyframes popoverIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.color-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #DADCE0;
    cursor: grab;
    user-select: none;
}

.color-popover-header:active {
    cursor: grabbing;
}

.color-popover.dragging .color-popover-header {
    cursor: grabbing;
}

.color-popover-title {
    font-size: 14px;
    font-weight: 500;
}

.color-popover-body {
    padding: 16px;
}

.color-popover-main {
    margin-bottom: 16px;
}

.color-gradient-picker {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    position: relative;
    cursor: crosshair;
    margin-bottom: 12px;
    background: linear-gradient(to bottom, transparent, #000),
                linear-gradient(to right, #fff, hsl(0, 100%, 50%));
}

.color-gradient-cursor {
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    pointer-events: none;
}

.color-hue-slider {
    width: 100%;
}

.hue-slider {
    width: 100%;
    height: 16px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 8px;
    background: linear-gradient(to right,
        hsl(0, 100%, 50%),
        hsl(60, 100%, 50%),
        hsl(120, 100%, 50%),
        hsl(180, 100%, 50%),
        hsl(240, 100%, 50%),
        hsl(300, 100%, 50%),
        hsl(360, 100%, 50%));
    outline: none;
    cursor: pointer;
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #333;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hue-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #333;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.color-popover-values {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.color-preview-large {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px solid #DADCE0;
    flex-shrink: 0;
}

.color-value-inputs {
    flex: 1;
}

.color-value-row {
    margin-bottom: 8px;
}

.color-value-row:last-child {
    margin-bottom: 0;
}

.color-value-row label {
    display: block;
    font-size: 10px;
    color: #5F6368;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

.color-value-row.rgb-row {
    display: flex;
    gap: 8px;
}

.color-value-row.rgb-row > div {
    flex: 1;
}

.hex-input-sm {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #DADCE0;
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
    text-transform: uppercase;
    background: #FFFFFF;
    color: #202124;
}

.hex-input-sm:focus {
    outline: none;
    border-color: #673AB7;
}

.rgb-input-sm {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #DADCE0;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    background: #FFFFFF;
    color: #202124;
}

.rgb-input-sm:focus {
    outline: none;
    border-color: #673AB7;
}

.rgb-input-sm::-webkit-inner-spin-button,
.rgb-input-sm::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.color-popover-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #DADCE0;
    background: #F1F3F4;
}

/* Popover backdrop */
.color-popover-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    display: none;
}

.color-popover-backdrop.open {
    display: block;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--card-background);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 500;
}

.modal-body {
    padding: 24px;
}

/* Send Modal */
.send-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.send-tab {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--hover-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.send-tab:hover,
.send-tab.active {
    background: var(--primary-color);
    color: white;
}

.send-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.send-content.hidden {
    display: none;
}

.send-content label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.send-content input,
.send-content textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.send-content textarea {
    min-height: 100px;
    resize: vertical;
}

.link-input-group {
    display: flex;
    gap: 8px;
}

.link-input-group input {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px !important;
    cursor: pointer;
}

.embed-options {
    display: flex;
    gap: 16px;
    align-items: center;
}

.embed-options input {
    width: 80px;
}

/* Responses Tab */
.responses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.responses-header h2 {
    font-size: 24px;
    font-weight: 400;
}

.responses-actions {
    display: flex;
    gap: 8px;
}

.responses-view-toggle {
    display: flex;
    background: var(--hover-bg);
    border-radius: 4px;
    padding: 4px;
    margin-bottom: 24px;
    width: fit-content;
}

.toggle-btn {
    padding: 8px 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--card-background);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.responses-content {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 24px;
}

/* Response Summary */
.response-summary-item {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.response-summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.response-summary-item h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.response-summary-item .response-count-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Chart styles */
.chart-container {
    max-width: 400px;
    margin: 16px 0;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    min-width: 120px;
    font-size: 14px;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--hover-bg);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.bar-value {
    min-width: 40px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Individual Response */
.individual-response {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.individual-response:last-child {
    border-bottom: none;
}

.response-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.response-answers {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.response-answer {
    padding: 12px;
    background: var(--hover-bg);
    border-radius: 4px;
}

.response-answer .question {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.response-answer .answer {
    font-size: 14px;
}

/* Settings Tab */
.settings-card {
    padding: 24px;
    margin-bottom: 16px;
}

.settings-card h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

.setting-item {
    padding: 8px 0;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.settings-card textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
}

/* No responses */
.no-responses {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
}

.no-responses .material-icons {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Drag and Drop */
.question-card.dragging {
    opacity: 0.5;
}

.question-card.drag-over {
    border-top: 3px solid var(--primary-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 400;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* Responsive */
@media (max-width: 900px) {
    .floating-toolbar {
        position: fixed;
        top: auto;
        bottom: 16px;
        right: 16px;
        transform: none;
        flex-direction: row;
    }

    .main-content {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .form-title-input {
        width: 100%;
        order: 3;
    }

    .question-header {
        flex-direction: column;
    }

    .question-type-select {
        width: 100%;
    }

    .responses-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* Title/Section Card */
.section-card {
    padding: 24px;
}

.section-title {
    width: 100%;
    border: none;
    font-size: 24px;
    font-family: 'Google Sans', sans-serif;
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid transparent;
}

.section-title:focus {
    outline: none;
    border-bottom: 2px solid var(--primary-color);
}

.section-description {
    width: 100%;
    border: none;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    border-bottom: 1px solid transparent;
}

.section-description:focus {
    outline: none;
    border-bottom: 2px solid var(--primary-color);
}

.section-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

/* Image/Video Card */
.media-card {
    padding: 24px;
}

.media-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.media-upload-area:hover {
    border-color: var(--primary-color);
}

.media-upload-area .material-icons {
    font-size: 48px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.media-upload-area p {
    color: var(--text-secondary);
    font-size: 14px;
}

.media-preview {
    max-width: 100%;
    border-radius: 4px;
}

.media-preview img,
.media-preview video {
    max-width: 100%;
    border-radius: 4px;
}

/* Required asterisk */
.required-asterisk {
    color: var(--error-color);
    margin-left: 4px;
}

/* Validation */
.validation-error {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
}

.input-error {
    border-color: var(--error-color) !important;
}

/* Loading state */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
