:root {
    --primary-color: #6a82fb;
    --secondary-color: #fc5c7d;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #333;
    --muted-text-color: #666;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --error-color: #f44336;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

header p {
    color: var(--muted-text-color);
    font-size: 1.1rem;
}

main {
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

section {
    margin-bottom: 2rem;
}

section:last-child {
    margin-bottom: 0;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f8f9fa;
}

.upload-area.dragover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(106, 130, 251, 0.3);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#videoUpload .upload-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236a82fb"><path d="M8 5v14l11-7z"/></svg>');
}

#funscriptUpload .upload-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23fc5c7d"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-2 14H8v-2h4v2zm0-4H8v-2h4v2zm-3-4V3.5L18.5 9H11z"/></svg>');
}

.upload-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.upload-content p {
    color: var(--muted-text-color);
}

.status-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.status-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.status-label {
    display: block;
    font-weight: 600;
    color: var(--muted-text-color);
}

.status-value {
    font-weight: 700;
}

.status-value.success {
    color: var(--success-color);
}

.status-value.error {
    color: var(--error-color);
}

.video-container {
    position: relative;
    margin-bottom: 1.5rem;
}

#vibration-visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0);
    box-shadow: 0 0 20px rgba(252, 92, 125, 0);
    transition: background-color 0.1s, box-shadow 0.1s;
    pointer-events: none; /* Allows clicks to go through to the video */
    border-radius: 8px;
}

#videoPlayer {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-btn,
.reset-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

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

.control-btn:hover {
    background-color: #586cdb;
    transform: translateY(-2px);
}

.reset-btn {
    background-color: var(--secondary-color);
    color: white;
    width: 100%;
    margin-top: 1rem;
}

.reset-btn:hover {
    background-color: #e64a66;
    transform: translateY(-2px);
}

.vibration-settings {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.vibration-settings h4 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.setting-group {
    display: grid;
    grid-template-columns: 100px 1fr 50px 24px;
    align-items: center;
    gap: 1rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    transition: opacity 0.2s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.setting-group span {
    font-weight: 600;
}

.checkbox-settings {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.setting-group-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.instructions {
    background-color: #eef2ff;
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 8px;
}

.instructions h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.instructions ol {
    list-style-position: inside;
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--muted-text-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Hint and Tooltip */
.hint {
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236a82fb"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>');
    cursor: help;
    transition: transform 0.2s;
}

.hint:hover {
    transform: scale(1.1);
}

.tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .upload-section, .settings-grid {
        grid-template-columns: 1fr;
    }

    .status-section {
        grid-template-columns: 1fr;
    }

    .setting-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .slider-container {
        justify-content: center;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }
}
