* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
    padding: 10px;
}

.container {
    display: flex;
    gap: 20px;
    height: 100vh;
    max-height: 100vh;
}

.control-panel {
    width: 300px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.control-panel h1 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-row h1 {
    margin: 0;
}

.dark-mode-btn {
    padding: 8px 12px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.dark-mode-btn:hover {
    background: #f5f5f5;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a1a;
}

body.dark-mode .control-panel {
    background: #2b2b2b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-mode .control-panel h1 {
    color: #f0f0f0;
}

body.dark-mode .section {
    border-bottom-color: #444;
}

body.dark-mode .section h2 {
    color: #ccc;
}

body.dark-mode label {
    color: #d0d0d0;
}

body.dark-mode small {
    color: #888;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="file"],
body.dark-mode input[type="color"],
body.dark-mode select {
    background: #3a3a3a;
    color: #f0f0f0;
    border-color: #555;
}

body.dark-mode input[type="range"] {
    accent-color: #007bff;
}

body.dark-mode input[type="file"]::file-selector-button {
    background: #007bff;
    border-color: #555;
}

body.dark-mode input[type="file"]::file-selector-button:hover {
    background: #0056b3;
}

body.dark-mode .status-text {
    background: #3a3a3a;
    color: #999;
}

body.dark-mode .status-text.active {
    background: #1a4d2e;
    color: #4ade80;
}

body.dark-mode .volume-meter {
    background: #3a3a3a;
    border-color: #555;
}

body.dark-mode .volume-info {
    color: #ccc;
}

body.dark-mode .mic-level-info {
    color: #999;
}

body.dark-mode .dark-mode-btn {
    border-color: #555;
}

body.dark-mode .dark-mode-btn:hover {
    background: #3a3a3a;
}

body.dark-mode .radio-label {
    color: #ccc;
}

body.dark-mode #canvas {
    border-color: #555;
}

body.dark-mode .canvas-area {
    background: #2b2b2b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-mode .drag-hint {
    background: rgba(0, 0, 0, 0.8);
    color: #f0f0f0;
}

.section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapse-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
    margin: 0;
    margin-top: 0;
}

.collapse-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.section-content {
    display: block;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 2000px;
    opacity: 1;
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

body.dark-mode .section h2 {
    color: #ccc;
}

body.dark-mode .collapse-btn {
    border-color: #555;
    color: #ccc;
}

body.dark-mode .collapse-btn:hover {
    background: #3a3a3a;
    border-color: #888;
}

.upload-group,
.background-group,
.mic-group,
.position-group,
.animation-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.color-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.color-row input[type="color"] {
    width: 60px;
    height: 34px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.animation-controls {
    margin-left: 10px;
    padding-left: 15px;
    border-left: 2px solid #ddd;
}

.animation-controls h3 {
    margin: 10px 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    cursor: pointer;
    margin: 0;
    width: 14px;
    height: 14px;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.button-group button {
    flex: 1;
    margin: 0;
    margin-right: 0;
    padding: 8px 12px;
    font-size: 11px;
}

input[type="text"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
}

label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

input[type="file"],
input[type="color"],
select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
}

input[type="file"]::file-selector-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

input[type="file"]::file-selector-button:hover {
    background: #0056b3;
}

input[type="color"] {
    height: 40px;
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
}

input[type="checkbox"] {
    cursor: pointer;
    margin-right: 6px;
}

small {
    font-size: 11px;
    color: #999;
}

button {
    padding: 10px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    margin-right: 8px;
    margin-top: 8px;
    font-size: 12px;
    transition: background 0.3s;
}

button:hover {
    background: #0056b3;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.status-text {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
}

.status-text.active {
    color: #27ae60;
    background: #f0f8f4;
}

.volume-meter {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.volume-bar {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #f39c12, #e74c3c);
    width: 0%;
    transition: width 0.1s ease-out;
}

.volume-info {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    text-align: center;
    font-weight: 500;
}

.audio-mixer-container {
    width: 100%;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #333;
    padding: 4px;
}

#audioMixer {
    display: block;
    width: 100%;
    height: auto;
}

/* Volume Display */
.volume-display {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-display label {
    white-space: nowrap;
    flex-shrink: 0;
}

.volume-bar-container {
    flex: 1;
    height: 24px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.volume-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.05s ease-out;
}

#volumeInfo {
    min-width: 40px;
    text-align: right;
    font-weight: bold;
    color: #4CAF50;
}

body.dark-mode .volume-bar-container {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode #volumeInfo {
    color: #66BB6A;
}

body.dark-mode .animation-controls {
    border-left-color: #444;
}

body.dark-mode .animation-controls h3 {
    color: #ccc;
}

.mic-level-info {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    text-align: center;
    font-weight: 500;
}

.canvas-area {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.animation-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#canvas {
    max-width: 100%;
    max-height: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: crosshair;
}

.drag-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.animation-container:hover .drag-hint {
    opacity: 1;
}

/* Scrollbar styling */
.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dark mode scrollbar */
body.dark-mode .control-panel::-webkit-scrollbar-track {
    background: #3a3a3a;
}

body.dark-mode .control-panel::-webkit-scrollbar-thumb {
    background: #666;
}

body.dark-mode .control-panel::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Feedback Button */
.feedback-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    margin: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feedback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.feedback-btn:active {
    transform: translateY(0);
}

body.dark-mode .feedback-btn {
    background: linear-gradient(135deg, #564ba2 0%, #843ba2 100%);
    box-shadow: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
}

body.dark-mode .modal-content {
    background: #2b2b2b;
    color: #f0f0f0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

body.dark-mode .modal-header {
    border-bottom-color: #444;
    background: #3a3a3a;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

body.dark-mode .modal-header h2 {
    color: #f0f0f0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #000;
}

body.dark-mode .close-modal {
    color: #999;
}

body.dark-mode .close-modal:hover {
    color: #fff;
}

.bug-report-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

body.dark-mode .form-group label {
    color: #ccc;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select,
.form-group input[type="file"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    background: white;
    color: #333;
}

body.dark-mode .form-group input[type="text"],
body.dark-mode .form-group textarea,
body.dark-mode .form-group select,
body.dark-mode .form-group input[type="file"] {
    background: #3a3a3a;
    color: #f0f0f0;
    border-color: #555;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.dark-mode .form-group input[type="text"]:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
    border-color: #667eea;
}

.form-group small {
    font-size: 11px;
    color: #999;
}

body.dark-mode .form-group small {
    color: #888;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    justify-content: flex-end;
}

body.dark-mode .modal-buttons {
    border-top-color: #444;
    background: #3a3a3a;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

body.dark-mode .btn-secondary {
    background: #555;
    color: #f0f0f0;
}

body.dark-mode .btn-secondary:hover {
    background: #666;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .control-panel {
        width: 250px;
        padding: 15px;
    }

    .section h2 {
        font-size: 13px;
    }

    label,
    small {
        font-size: 11px;
    }
}

@media (max-width: 800px) {
    .container {
        flex-direction: column;
        height: auto;
    }

    .control-panel {
        width: 100%;
        max-height: 40vh;
    }

    .canvas-area {
        width: 100%;
        height: 60vh;
    }
}
