/* --------------------------------------------- 
   Variablen 
--------------------------------------------- */
:root {
    --clr1: #09203F;
    --clr2: #537895;
    --clr3: #09203F;
    --clr4: #537895;
    --btn-bg: rgba(255, 255, 255, 0.85);
    --btn-shadow: rgba(0, 0, 0, 0.15);
    --input-bg: rgba(255, 255, 255, 0.7);
    --input-shadow: rgba(0, 0, 0, 0.05);
    --radius: 6px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --btn-gap: 0.75rem;
}

/* --------------------------------------------- 
   Basis-Layout 
--------------------------------------------- */
html, body {
    height: auto;
    min-height: 100%;
    overflow-y: auto !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    min-height: 100vh;
    background: linear-gradient(45deg, var(--clr1), var(--clr2), var(--clr3), var(--clr4));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --------------------------------------------- 
   Container mit Glassmorphism 
--------------------------------------------- */
.container {
    width: 100%;
    max-width: 800px;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.container, .header {
    background: rgba(255, 255, 255, 0.311);
    border-radius: var(--radius);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.header h1 {
    margin: 0;
    color: #000000;
    font-size: 2rem;
}

.chrome-extension-hint {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(209, 232, 255, 0.95));
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chrome-extension-hint .badge {
    background: #2563eb;
    color: #fff;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chrome-extension-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}

.chrome-extension-text {
    font-size: 0.9rem;
    color: #111827;
}

.chrome-extension-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
}

.chrome-extension-link:hover {
    background: #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

/* --------------------------------------------- 
   Settings-Bereich 
--------------------------------------------- */
#settings {
    background: rgba(255, 255, 255, 0.311);
    border-radius: var(--radius);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-top: 20px !important;
    margin-bottom: 15px;
}

.setting-row {
    margin-bottom: 1.5rem;
}

.setting-row label {
    display: block;
    color: #000000;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* --------------------------------------------- 
   Inputs & Select im Neumorphic-Stil 
--------------------------------------------- */
input[type="number"], 
input[type="range"],
.crop-aspect-select {
    -webkit-appearance: none;
    width: 97%;
    margin: 0.5rem 0;
    background: var(--input-bg);
    border: none;
    border-radius: var(--radius);
    box-shadow: inset 4px 4px 8px var(--input-shadow), inset -4px -4px 8px #fff;
    padding: 0.5rem;
    transition: box-shadow 0.2s ease;
    color: #333;
    font-size: 1rem;
}

input[type="number"] {
    padding: 0.7rem 1rem;
}

input[type="number"]:focus, 
input[type="range"]:focus,
.crop-aspect-select:focus {
    box-shadow: inset 2px 2px 6px var(--input-shadow), inset -2px -2px 6px #fff;
    outline: 2px solid rgba(36, 119, 209, 0.5);
}

input[type="range"] {
    height: 12px;
    padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 23px;
    height: 24px;
    background: rgb(255, 255, 255);
    box-shadow:#2d2d2dc0 0px 2px 15px 1px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

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

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

.crop-aspect-select {
    cursor: pointer;
    appearance: none;
    padding: 0.7rem 1rem;
}

/* --------------------------------------------- 
   Buttons im iOS-Neumorphic-Stil 
--------------------------------------------- */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--btn-gap);
    margin-top: 10px;
    margin-bottom: 10px;
}

.btn {
    background: var(--btn-bg);
    border: none;
    border-radius: var(--radius);
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    background: rgb(255, 255, 255);
}

.btn:focus {
    outline: 2px solid rgba(36, 119, 209, 0.5);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.65);
}

/* --------------------------------------------- 
   Output-Bereich 
--------------------------------------------- */
#output-container {
    background: rgba(255, 255, 255, 0.311);
    border-radius: var(--radius);
    backdrop-filter: blur(15px);
    padding: 1.5rem;
    margin-top: 1rem;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #000000;
}

.output-header h3 {
    margin: 0;
    color: #fff;
}

.char-count {
    background: var(--btn-bg);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.output-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    padding: 1.5rem;
    min-height: 150px;
    max-height: 500px;
    overflow-y: auto;
    color: #333;
    line-height: 1.8;
    font-size: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-box p {
    margin: 0 0 1rem 0;
}

.output-box p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------- 
   Utilities 
--------------------------------------------- */
.hidden {
    display: none !important;
}

/* --------------------------------------------- 
   Navigation Links mit Slide-In & Hover-Effekt 
--------------------------------------------- */
.contact {
    position: fixed;
    bottom: 1rem;
    left: 90%;
    transform: translateX(-50%) translateY(20px);
    background: var(--btn-bg);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: #333;
    font-weight: bold;
    opacity: 0;
    animation: slideUpFadeIn 0.8s ease-out forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.upscaler {
    position: fixed;
    left: 10%;
    bottom: 1rem;
    background: var(--btn-bg);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: #333;
    font-weight: bold;
    opacity: 0;
    animation: slideUpFadeIn 0.8s ease-out forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

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

.contact::after {
    content: "";
    display: block;
    margin: 0.25rem auto 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--clr1), var(--clr3));
    transition: width 0.4s ease;
}

.contact:hover {
    transform: translateX(-50%) translateY(-3px);
    background: rgba(255, 255, 255, 1);
}

.contact:hover::after {
    width: 100%;
}

.upscaler:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 1);
}

.privacy-link {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%) translateY(20px);
    background: var(--btn-bg);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: #333;
    font-weight: bold;
    opacity: 0;
    animation: slideUpFadeIn 0.8s ease-out 0.2s forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.privacy-link:hover {
    transform: translateX(-50%) translateY(-3px);
    background: rgba(255, 255, 255, 1);
}

.privacy-link::after {
    content: "";
    display: block;
    margin: 0.25rem auto 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--clr1), var(--clr3));
    transition: width 0.4s ease;
}

.privacy-link:hover::after {
    width: 100%;
}

/* --------------------------------------------- 
   Responsive 
--------------------------------------------- */
@media (max-width: 768px) {
    .contact {
        left: 50%;
        bottom: 1rem;
    }
    
    .upscaler {
        left: 50%;
        bottom: 4rem;
        transform: translateX(-50%);
    }
    
    .privacy-link {
        left: 50%;
        bottom: 2.5rem;
        transform: translateX(-50%);
    }
    
    body {
        padding: 1rem 0.5rem;
    }
    
    .container, .header, #settings, #output-container {
        padding: 1rem;
    }
}