/* Import Fonts */
@import url('fonts.css');

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

:root {
    --color-primary: #764ba2;
    --color-primary-dark: #5a3780;
    --color-primary-light: #9b6bc2;
    --color-text: #2c2c2c;
    --color-text-light: #666;
    --color-bg: #ffffff;
    --color-bg-light: #f8f9fa;
    --color-border: #e0e0e0;
    --color-success: #28a745;
    --color-error: #dc3545;
}

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    padding: 0;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--color-bg);
    color: var(--color-text);
    padding: 4rem 2rem 3rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    font-weight: 400;
    letter-spacing: 0.01em;
}

main {
    padding: 3rem 2rem;
    flex: 1;
}

.generator-form {
    margin-bottom: 3rem;
}

.form-group-main {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.form-group-main .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--color-text);
    font-size: 1rem;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.2s ease;
    background: var(--color-bg);
    color: var(--color-text);
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.block-type-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23764ba2' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.block-type-select:hover {
    border-color: var(--color-primary-light);
}

.block-type-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--color-bg);
    font-size: 0.95rem;
}

.radio-label:hover {
    border-color: var(--color-primary-light);
    background: rgba(118, 75, 162, 0.03);
}

.radio-label input[type="radio"] {
    width: auto;
    margin-right: 0.625rem;
    margin-left: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--color-primary);
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--color-primary);
    background: rgba(118, 75, 162, 0.08);
}

/* Stimmigkeitsregler Styles */
.stimmigkeitsregler {
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.stimmigkeitsregler-label {
    display: block;
    margin-bottom: 1.25rem;
    font-weight: 500;
    color: var(--color-text);
    font-size: 1rem;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.slider-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-weight: 400;
}

.slider-label-left,
.slider-label-right {
    font-weight: 400;
    letter-spacing: 0.01em;
}

.stimmigkeits-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--color-border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.stimmigkeits-slider:hover {
    background: rgba(118, 75, 162, 0.2);
}

/* Webkit Slider Thumb */
.stimmigkeits-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(118, 75, 162, 0.2);
}

.stimmigkeits-slider::-webkit-slider-thumb:hover {
    background: var(--color-primary-dark);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.3);
}

/* Firefox Slider Thumb */
.stimmigkeits-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(118, 75, 162, 0.2);
}

.stimmigkeits-slider::-moz-range-thumb:hover {
    background: var(--color-primary-dark);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.3);
}

/* Firefox Track */
.stimmigkeits-slider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--color-border);
    border: none;
}

.btn-generate {
    width: 100%;
    padding: 1.125rem 2rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.btn-generate:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.btn-generate:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(118, 75, 162, 0.2);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.btn-refine {
    width: 100%;
    padding: 0.875rem 2rem;
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.btn-refine:hover {
    background: rgba(118, 75, 162, 0.05);
    border-color: var(--color-primary-dark);
    color: var(--color-primary-dark);
}

.btn-refine:active {
    background: rgba(118, 75, 162, 0.1);
}

.btn-settings-fixed {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text-light);
    border: 1.5px solid var(--color-border);
    border-radius: 50%;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-settings-fixed:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
    transform: translateY(-2px);
}

.btn-settings-fixed:active {
    transform: translateY(0);
}

.btn-settings-fixed svg {
    width: 20px;
    height: 20px;
}

/* Off-Canvas Menü */
.offcanvas-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.offcanvas-menu.open {
    pointer-events: all;
    opacity: 1;
}

.offcanvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.offcanvas-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--color-bg);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.offcanvas-menu.open .offcanvas-content {
    transform: translateX(0);
}

.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.offcanvas-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.btn-close-offcanvas {
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-close-offcanvas:hover {
    background: var(--color-bg-light);
    color: var(--color-text);
}

.offcanvas-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.offcanvas-body .form-group {
    margin-bottom: 2rem;
}

.offcanvas-body .stimmigkeitsregler {
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.offcanvas-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-light);
    flex-shrink: 0;
}

.btn-apply-settings {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.btn-apply-settings:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.btn-apply-settings:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(118, 75, 162, 0.2);
}

@media (max-width: 480px) {
    .offcanvas-content {
        max-width: 100%;
    }
    
    .form-group-main {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-settings {
        width: 100%;
        justify-content: center;
    }
}

.loading {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--color-primary);
    font-size: 1.1rem;
}

.result {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.result-header h2 {
    font-size: 1.75rem;
    color: var(--color-text);
    font-weight: 600;
}

.btn-copy {
    padding: 0.625rem 1.25rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: var(--color-primary-dark);
}

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

.result-info {
    margin-bottom: 1.5rem;
    padding: 0.875rem 1rem;
    background: var(--color-bg-light);
    border-radius: 6px;
    color: var(--color-text-light);
    font-size: 0.9rem;
    text-align: center;
}

.result-content {
    line-height: 1.9;
}

.result-content p {
    margin-bottom: 1.75rem;
    color: var(--color-text);
    font-size: 1.05rem;
    font-weight: 400;
    opacity: 0.7;
    transition: opacity 0.4s ease;
    cursor: default;
    position: relative;
}

/* Hover: Satz wird vollständig opak */
.result-content p:hover {
    opacity: 1;
}

/* Wenn über result-content gehovert wird, alle Sätze leicht dämpfen */
.result-content:hover p {
    opacity: 0.6;
}

/* Hover-Satz bleibt opak */
.result-content:hover p:hover {
    opacity: 1;
}

/* Benachbarte Sätze (vorheriger und nächster) werden subtil weiter gedämpft */
.result-content p.hover-adjacent {
    opacity: 0.5;
}

.result-content p.hover-active {
    opacity: 1;
}

.error {
    padding: 1.125rem 1.25rem;
    background: #fee;
    color: var(--color-error);
    border-radius: 6px;
    border-left: 4px solid var(--color-error);
    margin-top: 1.5rem;
    font-weight: 500;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    font-weight: 500;
    font-family: 'Quicksand', sans-serif;
    animation: slideUp 0.3s ease-out;
    max-width: 90%;
    text-align: center;
}

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

.toast.error {
    background: var(--color-error);
    color: white;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

footer {
    background: var(--color-bg-light);
    border-top: 1px solid var(--color-border);
    padding: 2.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-section {
    text-align: center;
}

.footer-version {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.footer-credits {
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-weight: 400;
}

.footer-credits a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.footer-credits a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.footer-legal {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.footer-legal a {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-separator {
    color: var(--color-border);
    margin: 0 0.75rem;
    font-weight: 300;
}

@media (max-width: 768px) {
    header {
        padding: 3rem 1.5rem 2rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    main {
        padding: 2rem 1.5rem;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .btn-copy {
        width: 100%;
    }
    
    footer {
        padding: 2rem 1.5rem;
    }
    
    .footer-content {
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .radio-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .radio-label {
        width: 100%;
    }
}
