body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    box-sizing: border-box;
}


h1 {
    font-size: 2.5rem;
    color: #2a9d8f;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-overlay.hidden {
  display: none;
}

.spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #2a9d8f;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.loading-text {
  font-size: 1.7rem;
  color: #2a9d8f;
  font-weight: 500;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.5); /* schwarze Umrandung */
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s;
    box-sizing: border-box;
    overflow: hidden;
    overflow-y: hidden;
    overflow-x: hidden;
}

textarea:focus {
    outline: none;
    border-color: #2a9d8f;
}

button {
    padding: 12px 20px;
    font-size: 1rem;
    color: #ffffff;
    background-color: #2a9d8f;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s, box-shadow 0.2s;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: #21867a;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

button:active {
    background-color: #1b6d63;
}

#output {
    margin-top: 0px;
    padding: 15px;
    font-size: 1.2rem;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    min-height: 80px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

#output-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    width: 100%;
}

/* Extra small screens (320px - 480px) */
@media (max-width: 480px) {
    .container {
        padding: 8px;
        width: 98%;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    #output-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .right-panel {
        padding: 15px;
    }

    textarea {
        padding: 10px;
        min-height: 100px;
    }

    button {
        padding: 10px 16px;
    }

    select#text-config {
        padding: 8px 10px;
    }

    .section {
        padding: 8px;
        margin-bottom: 8px;
        word-break: break-word;
        hyphens: auto;
    }

    .section h3 {
        font-size: 0.7rem;
    }

    .section p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .toggles {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    .switch {
        justify-content: flex-start !important;
        padding: 10px 0 !important;
    }

    .toggle-label {
        font-size: 14px !important;
    }

    .slider {
        width: 40px !important;
        height: 20px !important;
    }

    .slider:before {
        width: 16px !important;
        height: 16px !important;
    }

    input:checked+.slider:before {
        transform: translateX(20px) !important;
    }

    .rating-system {
        padding: 15px;
        margin-top: 20px;
    }

    .rating-system h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .criterion-label {
        font-size: 0.85rem !important;
    }

    .rating-circle {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

.section {
    border: 1px solid #ccc;
    padding: 10px;
    box-sizing: border-box;
    background-color: #f9f9f9;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    overflow-x: hidden;
}


/* Styling for the toggles */
.toggles {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 20px !important;
    margin-bottom: 20px;
    padding: 0;
    background: none;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    transition: none;
    flex: 1;
    justify-content: center;
    box-sizing: border-box;
}

.switch:hover {
    transform: none;
}

.switch input:checked + .slider + .toggle-label {
    color: #2a9d8f;
}

.switch input:checked ~ * {
    border-color: #2a9d8f;
}

.switch input {
    display: none;
}

.slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

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

input:checked+.slider {
    background-color: #2a9d8f;
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    flex: 1;
}

#send-button {
    margin-bottom: 10px;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2a9d8f;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    z-index: 1000;
    animation: fade-in-out 3s ease-in-out;
}

@keyframes fade-in-out {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    10%,
    90% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}


.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    width: 60px;
    height: 30px;
    background-color: #ddd;
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    justify-content: center;
}

.toggle[data-state="on"] {
    background-color: #2a9d8f;
}

.toggle::after {
    content: "";
    width: 26px;
    height: 26px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s, background-color 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle[data-state="on"]::after {
    transform: translateX(30px);
}

.toggle-label {
    font-size: 1rem;
    color: #333;
    cursor: pointer;
}

.rating-system h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 0;
    background: none;
    border: none;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.criterion {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
    margin: 0;
    padding: 10px 5px;
    background: none;
    border: none;
    box-sizing: border-box;
    min-width: 0;
}

.criterion-label {
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
}


.rating {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.rating-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    color: #333;
    position: relative;
}

.rating-circle.full {
    background-color: #2a9d8f;
    color: white;
}

.rating-circle.half::after {
    content: "";
    width: 50%;
    height: 100%;
    background-color: #2a9d8f;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 15px 0 0 15px;
}

/* Force wrap at 1170px */
@media (max-width: 1170px) {
    .criterion {
        flex: 0 1 200px;
    }
}

/* Medium screens - adjust styling when wrapped */
@media (max-width: 1170px) and (min-width: 811px) {
    .rating-row {
        gap: 20px;
        justify-content: center;
    }
    
    .criterion {
        padding: 12px 8px;
    }
}

/* Mobile breakpoint */
@media (max-width: 810px) {
    .container {
        flex-direction: column;
        padding: 10px;
        width: 95%;
    }

    h1 {
        font-size: 2rem;
    }

    textarea {
        height: 100px;
    }

    .toggles {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: stretch !important;
    }

    .switch {
        justify-content: flex-start !important;
        padding: 12px 0 !important;
    }

    .toggle-label {
        font-size: 16px !important;
    }

    .slider {
        width: 44px !important;
        height: 22px !important;
    }

    .slider:before {
        width: 18px !important;
        height: 18px !important;
    }

    input:checked+.slider:before {
        transform: translateX(22px) !important;
    }

    .toggle-group {
        justify-content: center;
        gap: 10px;
    }

    .rating-system {
        margin-top: 30px;
        padding: 20px;
        background-color: #f4f4f4;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    .rating-row {
        flex-direction: column;
        gap: 20px;
        align-items: center;
        justify-content: center;
    }

    .criterion {
        padding: 15px 0;
        justify-content: center;
        width: 100%;
        max-width: none;
        min-width: auto;
        flex: none;
    }

    .criterion-label {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }

    .rating-circle {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .criterion-label {
        font-size: 0.9rem;
    }
}

.underline-layer {
    display: block;
    height: 2px;
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: -1;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 0px;
}

.tab {
    padding: 10px 20px;
    background-color: #ddd;
    border: 1px solid #ccc;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: center;
    margin-right: 5px;
}

.tab:hover {
    background-color: #2a9d8f;
    color: white;
}

.tab.active {
    background-color: #2a9d8f;
    color: white;
    border-bottom: none;
}

.output-textbox {
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    padding: 10px;
    background-color: #f4f4f4;
    min-height: 100px;
    font-size: 1rem;
    overflow-y: auto;
}

.section {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section h3 {
    font-size: 1.2rem;
    margin: 0 0 5px 0;
    color: #2a9d8f;
}

.section p {
    font-size: 1rem;
    margin: 0;
    color: #333;
}


.section {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section h3 {
    font-size: 0.75rem;
    font-weight: normal;
    margin: 0 0 5px 0;
}

.section p {
    font-size: 1rem;
    margin: 0;
}

.label-outside {
    background-color: #e0e0e0;
    color: #a1a1a1;
}

.label-o>p {
    color: #a1a1a1;
}

.label-introduction {
    background-color: #d1e7dd;
    color: #0f5132;
}

.label-body {
    background-color: #cfd4fc;
    color: #0f5132;
}

.label-conclusion {
    background-color: #f8d7da;
    color: #0f5132;
}

.label-argument {
    background-color: #d1e7dd;
    color: #0f5132;
}

.label-counter-argument {
    background-color: #cff4fc;
    color: #0f5132;
}

.label-topic {
    background-color: #cff4fc;
    color: #0f5132;
}

.label-thesis {
    background-color: #f8d7da;
    color: #0f5132;
}

.label-antithesis {
    background-color: #fff3cd;
    color: #0f5132;
}

.label-modified-thesis {
    background-color: #e5d8f6;
    color: #0f5132;
}

.label-claim {
    background-color: #ffe5d9;
    color: #0f5132;
}

.label-premise {
    background-color: #e0f7fa;
    color: #0f5132;
}

.label-positioning {
    background-color: #d1e7dd;
    color: #0f5132;
}

.label-describing {
    background-color: #cff4fc;
    color: #0f5132;
}

.label-exemplifying {
    background-color: #f8d7da;
    color: #0f5132;
}

.label-reasoning {
    background-color: #fff3cd;
    color: #0f5132;
}

.label-conceding {
    background-color: #e5d8f6;
    color: #0f5132;
}

.label-referencing {
    background-color: #ffe5d9;
    color: #0f5132;
}

.label-comparing {
    background-color: #d6f5e9;
    color: #0f5132;
}

.label-instructing {
    background-color: #ffe4e1;
    color: #0f5132;
}

.label-qualifying {
    background-color: #e0f7fa;
    color: #0f5132;
}

.label-concluding {
    background-color: #dceeff;
    color: #0f5132;
}

/* Select dropdown styling */
select#text-config {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin: 10px 0 20px 0;
    transition: border-color 0.3s, box-shadow 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6H0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

select#text-config:focus {
    border-color: #2a9d8f;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.2);
    outline: none;
}

/* Label before dropdown */
label[for="text-config"] {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    font-size: 1rem;
    color: #333;
}

/* Right panel spacing */
.right-panel {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    width: 100%;
    box-sizing: border-box;
}

/* Optional: unify all section look */
.output-section,
.rating-system {
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    margin-top: 20px;
}

.footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: #666;
    background-color: #f0f0f0;
    margin-top: 40px;
    border-top: 1px solid #ddd;
}

.footer a {
    color: #2a9d8f;
    text-decoration: none;
}

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

/* Ratings placeholder styling */
.ratings-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    font-size: 1rem;
    background-color: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.ratings-placeholder p {
    margin: 0;
    line-height: 1.4;
}
