:root {
    --bg-dark: #050505;
    --bg-panel: #0f1215;
    --accent-blue: #00BFFF;
    --accent-glow: rgba(0, 191, 255, 0.3);
    --text-main: #e0e0e0;
    --text-muted: #8899a6;
    --border-color: #333;
    --error-red: #ff3333;
    --success-green: #00ff41;
    --accent-orange: #FFA500;
}

/* === MODALS === */
.modal, .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.active, .modal-overlay.active, .modal-overlay[style*="display: flex"], .modal-overlay[style*="display: block"] {
    display: flex !important;
}

.modal-box {
    background: var(--bg-panel);
    padding: 25px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--accent-blue);
    box-shadow: 0 0 30px rgba(0,191,255,0.2);
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px auto;
    position: relative;
    border-radius: 4px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover {
    color: var(--accent-blue);
}

/* Modal Title */
.modal-box h3 {
    color: var(--accent-blue);
    margin-bottom: 15px;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Modal Text */
.modal-box p {
    color: var(--text-main);
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.5;
}

/* Modal Buttons */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #555;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    font-weight: bold;
    transition: all 0.2s;
}

.modal-btn:hover {
    border-color: #fff;
}

.modal-btn.primary {
    background: rgba(0, 191, 255, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.modal-btn.primary:hover {
    background: var(--accent-blue);
    color: #000;
    box-shadow: 0 0 15px var(--accent-glow);
}



/* === DISCLAIMER BANNER (Ticker) === */
.disclaimer-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 36px;
    background-color: #ff0000; /* Signal Red */
    color: #ffffff;
    z-index: 99999; /* Highest z-index */
    display: flex;
    align-items: center;
    overflow: hidden;
    font-family: 'Roboto Mono', monospace;
    font-weight: bold;
    font-size: 14px;
    line-height: 36px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.marquee-track {
    display: flex;
    white-space: nowrap;
    animation: marquee-scroll 80s linear infinite;
    will-change: transform;
}

.marquee-content {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevent shrinking */
}

.marquee-item {
    margin-right: 50px; /* Space between repeats */
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === TOAST NOTIFICATIONS === */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20000; /* High z-index to stay on top */
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(15, 18, 21, 0.95);
    color: var(--text-main);
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-blue);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    min-width: 250px;
    max-width: 350px;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: auto;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success { border-left-color: var(--success-green); }
.toast.error { border-left-color: var(--error-red); }
.toast.info { border-left-color: var(--accent-blue); }

/* === GLOBAL LOADER === */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(3px);
    z-index: 15000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#global-loader.active {
    display: flex;
}

.loader-spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 191, 255, 0.1);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.loader-text {
    color: var(--accent-blue);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse 1.5s infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* === USER BADGES === */
.user-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: bold;
    border: 1px solid transparent;
    display: inline-block;
    line-height: 1.2;
}

.badge-founder {
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    background-color: rgba(255, 165, 0, 0.1);
}

.badge-dev {
    color: #A855F7;
    border-color: #A855F7;
    background-color: rgba(168, 85, 247, 0.1);
}

.badge-admin {
    color: var(--error-red);
    border-color: var(--error-red);
    background-color: rgba(255, 51, 51, 0.1);
}

.badge-beta {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background-color: rgba(0, 191, 255, 0.1);
}

.badge-pro {
    color: #FACC15;
    border-color: #FACC15;
    background-color: rgba(250, 204, 21, 0.1);
}

.badge-partner {
    color: var(--success-green);
    border-color: var(--success-green);
    background-color: rgba(0, 255, 65, 0.1);
}

.badge-vip {
    color: #00FFFF;
    border-color: #00FFFF;
    background-color: rgba(0, 255, 255, 0.1);
}

.badge-demo {
    color: #888;
    border-color: #888;
    background-color: rgba(136, 136, 136, 0.1);
}

/* Read Message Style */
.msg-card.read-message {
    opacity: 0.7;
    filter: grayscale(30%);
    border-left: 3px solid #333; /* Neutral border instead of Accent */
}
.msg-card.read-message:hover {
    opacity: 1;
    filter: grayscale(0%);
    border-left-color: var(--accent-blue);
}

/* === WIZARD / NO-SCROLL LAYOUT (Single Screen) === */
.wizard-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px); /* Total Viewport Height - Header/Padding */
    overflow: hidden; /* Prevent page scroll */
    width: 100%; /* Mobile default */
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 10px;
    box-sizing: border-box;
}

/* Responsive Desktop Width (already 100% on mobile) */
@media (min-width: 1024px) {
    .wizard-container {
        width: 95%; /* Clean margins on desktop */
    }
}

.wizard-header {
    flex-shrink: 0;
    margin-bottom: 15px;
}

.wizard-step-input {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow growing to fill empty space */
    flex-shrink: 1; /* Allow shrinking if needed */
    transition: all 0.3s ease;
    min-height: 0; /* Important for flex child scrolling */
    margin-bottom: 5px; /* Base spacing to prevent direct overlap */
    padding-bottom: 5px;
}

/* Textarea Defaults */
.input-group-wrapper {
    min-height: 0;
    overflow: hidden;
}

.wizard-textarea {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid #333;
    border-left: 3px solid #333;
    color: #fff;
    padding: 15px;
    padding-right: 45px; /* Prevent text overlap with absolute icons/buttons */
    font-size: 1rem;
    border-radius: 4px;
    resize: none; /* Controlled by CSS */

    /* Standard Input Mode (State 1) */
    flex-grow: 1;
    min-height: 100px; /* Absolute minimum */
    height: 0;         /* Flexbox fill strategy */
    overflow-y: auto;  /* Internal scrolling */
}

.wizard-textarea:focus {
    border-color: var(--accent-blue);
    border-left-color: var(--accent-blue);
    background: rgba(0, 191, 255, 0.05);
}

/* Compressed Input State (State 3: Button Visible) */
/* Force shrink to allow room for Button and Meta */
.wizard-step-input.compressed {
    flex-grow: 0 !important;
    flex-shrink: 1 !important;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.wizard-step-input.compressed .wizard-textarea,
.wizard-step-input.compressed #messageInput {
    max-height: 35vh !important; /* Limit height to ~1/3 of screen */
    min-height: 120px !important; /* Keep it usable */
    flex-grow: 0 !important;
}

/* Minimized Input State (State 2: Result Visible) */
.wizard-step-input.minimized {
    flex-grow: 0;
    flex-shrink: 0;
    margin-bottom: 10px;
}

.wizard-step-input.minimized .wizard-textarea,
.wizard-step-input.minimized #messageInput {
    height: 120px !important; /* ~5 lines fixed */
    min-height: 120px !important;
    max-height: 120px !important;
    flex-grow: 0;
    overflow-y: auto !important;
}

.wizard-step-input.minimized .input-icons-wrapper,
.wizard-step-input.minimized label {
    display: none;
}

/* Progressive Disclosure: Meta & Action */
.wizard-meta {
    flex-shrink: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-height: 300px;
    margin-bottom: 10px;
}

.wizard-action {
    flex-shrink: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-height: 100px;
    margin-bottom: 10px;
}

.wizard-result {
    opacity: 1;
    max-height: 1000px;
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0; /* Enable internal scroll */
    overflow: hidden; /* Container itself doesn't scroll, content does */
}

/* Ensure output area handles overflow */
#messageOutput {
    flex-grow: 1;
    height: auto;
    overflow-y: auto;
    min-height: 100px;
}

/* Hidden Utility Class for Transitions */
.hidden {
    opacity: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    pointer-events: none;
    padding: 0 !important;
    border: none !important;
}

/* Icon Buttons inside Input */
.input-icons-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    transition: all 0.3s ease;
    z-index: 5;
}

/* Reset Button inside Input (X) */
.input-reset-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 8px; /* Larger hit area */
    z-index: 10;
    display: none; /* Hidden by default */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.input-reset-btn:hover {
    background: rgba(255, 50, 50, 0.1);
    color: var(--error-red);
}

.input-icons-wrapper.hide-icons {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* File Info (Upload Feedback) */
#fileInfo {
    margin-top: 10px;
    margin-bottom: 20px !important; /* Force spacing below file info */
    flex-shrink: 0; /* Never shrink this info line */
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
    color: var(--accent-blue);
    padding: 5px;
    border-radius: 50%;
}
.icon-btn:hover {
    opacity: 1;
    background: rgba(0, 191, 255, 0.1);
}

.result-header {
    font-size: 0.8rem;
    color: var(--success-green);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-textarea {
    border-color: var(--success-green);
    color: var(--success-green);
    font-weight: bold;
    flex: 1;
    margin-bottom: 15px;
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Ziel: Alle Scrollbars im Tool-Bereich unsichtbar machen */
.wizard-container,
.wizard-step-input,
textarea,
#messageInput,
#messageOutput {
    -ms-overflow-style: none !important;  /* IE und Edge */
    scrollbar-width: none !important;     /* Firefox */
}

.wizard-container::-webkit-scrollbar,
.wizard-step-input::-webkit-scrollbar,
textarea::-webkit-scrollbar,
#messageInput::-webkit-scrollbar,
#messageOutput::-webkit-scrollbar {
    display: none !important;             /* Chrome, Safari, Opera */
}

/* Desktop Optimierung */
.app-main-wrapper {
    max-width: 600px; /* Default (Mobile/Tablet) */
}

@media (min-width: 1024px) {
    .app-main-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: none !important;
    }

    .wizard-container {
        width: 90% !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 40px;
    }

    /* Ensure Input fills vertical space on Desktop */
    .wizard-step-input {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    #mainSection {
        width: 100%;
    }

    textarea, #messageInput {
        width: 100% !important;
        flex-grow: 1; /* Fill the wrapper */
        height: auto !important;
        min-height: 400px; /* Minimum visual size */
    }

    /* Ensure other sections stay narrow on desktop */
    #loginSection,
    #activationSection,
    #renewalSection,
    #blockedSection,
    #infoSection,
    #guideSection {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Force Minimized State (Must be last to override Desktop styles) */
.wizard-step-input.minimized .wizard-textarea,
.wizard-step-input.minimized #messageInput {
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    flex-grow: 0 !important;
    overflow-y: auto !important;
}

.wizard-step-input.minimized {
    flex-grow: 0 !important;
    min-height: 0 !important;
}

/* === SECURITY PULSE ANIMATION === */
@keyframes security-flash-anim {
    0% { color: var(--success-green); text-shadow: 0 0 10px var(--success-green); transform: scale(1); }
    50% { color: #fff; text-shadow: 0 0 20px #fff; transform: scale(1.1); }
    100% { color: var(--success-green); text-shadow: 0 0 10px var(--success-green); transform: scale(1); }
}

.security-pulse {
    animation: security-flash-anim 0.8s ease-out;
}

/* === GUIDE ACCORDION (Interactive Manual) === */
.accordion-guide-item {
    margin-bottom: 10px;
    border: 1px solid #222;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.accordion-guide-item.active {
    border-color: var(--accent-blue);
    background: rgba(0, 191, 255, 0.05);
}

.accordion-guide-header {
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
}

.accordion-guide-header:hover {
    color: var(--accent-blue);
}

.accordion-guide-header .arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.accordion-guide-item.active .accordion-guide-header {
    color: var(--accent-blue);
}

.accordion-guide-item.active .arrow {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--accent-blue);
}

.accordion-guide-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid transparent;
}

.accordion-guide-item.active .accordion-guide-body {
    /* Large enough max-height to fit content, but not too large to break transition speed feel */
    max-height: 1500px;
    opacity: 1;
    border-top-color: rgba(0, 191, 255, 0.1);
}

.accordion-guide-content {
    padding: 20px;
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
}

.guide-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

/* === SECURITY FIELDS (Hidden/Masked) === */
input.secret-field {
    -webkit-text-security: disc;
    text-security: disc;
    font-family: 'Roboto Mono', monospace;
}
