/* Venn Diagram Generator Styles */
:root {
    --bg-deep: #0a0f1a;
    --bg-card: #0d1526;
    --bg-input: #16213e;
    --text-primary: #e8f4f8;
    --text-secondary: #8aa4af;
    --text-muted: #5a7a8a;
    --accent: #3b9ebe;
    --accent-glow: rgba(59, 158, 190, 0.3);
    --success: #00b894;
    --warning: #ff6b6b;
    --border-color: rgba(59, 158, 190, 0.2);
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ocean Background */
.ocean-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(180deg,
        #0a0f1a 0%,
        #0d1829 30%,
        #0f1f35 60%,
        #0a1525 100%);
}

.bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -20px;
    background: radial-gradient(circle at 30% 30%,
        rgba(125, 211, 252, 0.3),
        rgba(59, 158, 190, 0.1));
    border-radius: 50%;
    animation: rise linear infinite;
}

.bubble:nth-child(1) { width: 20px; height: 20px; left: 10%; animation-duration: 12s; animation-delay: 0s; }
.bubble:nth-child(2) { width: 15px; height: 15px; left: 20%; animation-duration: 15s; animation-delay: 2s; }
.bubble:nth-child(3) { width: 25px; height: 25px; left: 35%; animation-duration: 10s; animation-delay: 4s; }
.bubble:nth-child(4) { width: 18px; height: 18px; left: 50%; animation-duration: 14s; animation-delay: 1s; }
.bubble:nth-child(5) { width: 22px; height: 22px; left: 65%; animation-duration: 11s; animation-delay: 3s; }
.bubble:nth-child(6) { width: 12px; height: 12px; left: 75%; animation-duration: 16s; animation-delay: 5s; }
.bubble:nth-child(7) { width: 28px; height: 28px; left: 85%; animation-duration: 13s; animation-delay: 2s; }
.bubble:nth-child(8) { width: 16px; height: 16px; left: 5%; animation-duration: 17s; animation-delay: 6s; }
.bubble:nth-child(9) { width: 20px; height: 20px; left: 45%; animation-duration: 12s; animation-delay: 4s; }
.bubble:nth-child(10) { width: 14px; height: 14px; left: 90%; animation-duration: 15s; animation-delay: 1s; }

@keyframes rise {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    50% { opacity: 0.4; }
    100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

.light-rays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 0%,
        rgba(125, 211, 252, 0.08) 0%,
        transparent 60%);
    pointer-events: none;
}

/* Sound Toggle */
.sound-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sound-toggle.sound-on {
    border-color: var(--success);
    color: var(--success);
}

.sound-toggle svg {
    width: 20px;
    height: 20px;
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Controls Section */
.controls-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.control-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-row:last-of-type {
    margin-bottom: 0;
}

/* Colors Row */
.colors-row {
    justify-content: center;
    gap: 40px;
}

.color-picker-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.color-picker-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.color-picker-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Input Groups */
.input-group {
    flex: 1;
    min-width: 150px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Slider Groups */
.slider-group {
    flex: 1;
    min-width: 150px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slider-header label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.percent-value {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-input);
    border-radius: 3px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Total Indicator */
.total-indicator {
    text-align: center;
    padding: 12px;
    background: var(--bg-input);
    border-radius: 8px;
    font-weight: 600;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.total-indicator.valid {
    color: var(--success);
    border: 1px solid var(--success);
}

.total-indicator.invalid {
    color: var(--warning);
    border: 1px solid var(--warning);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

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

.copy-btn:hover {
    background: #00a884;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.4);
}

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

.download-btn:hover {
    background: #2d8aa8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Canvas Section */
.canvas-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#vennCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Status Message */
.status-message {
    text-align: center;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 16px;
}

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

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

/* Help Section */
.help-section {
    margin-bottom: 24px;
}

.help-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.help-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.help-toggle svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.help-toggle.active {
    border-color: var(--accent);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.help-content {
    display: none;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.help-content.show {
    display: block;
}

.help-diagram {
    text-align: center;
    margin-bottom: 16px;
}

.help-svg {
    max-width: 300px;
    width: 100%;
}

.help-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.help-text p {
    margin-bottom: 12px;
}

.help-text ul {
    margin: 0 0 16px 20px;
}

.help-text li {
    margin-bottom: 6px;
}

.help-example {
    background: var(--bg-input);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.help-example p {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.example-table {
    width: 100%;
    border-collapse: collapse;
}

.example-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
}

.example-table td:first-child {
    color: var(--text-muted);
    width: 40%;
}

.example-table tr:last-child td {
    border-bottom: none;
}

.help-tip {
    background: rgba(59, 158, 190, 0.1);
    border-left: 3px solid var(--accent);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-top: 16px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .control-row {
        flex-direction: column;
        gap: 15px;
    }

    .colors-row {
        flex-direction: row;
    }

    .input-group {
        min-width: 100%;
    }

    .slider-group {
        min-width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

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

    #vennCanvas {
        width: 100%;
    }
}
