/* ======================================================================================== */
/* Globales CSS                                                                             */
/* Projekt: JS Demo FormData und Security                                                   */
/* Description: Kombiniert Layout-Basis, Formular-Validierung und Workshop-Cards.           */
/* Autor: BRULSIM                                                                           */
/* Datum: 2026-06-18                                                                        */
/* ======================================================================================== */


/* --- 1. GLOBAL & LAYOUT SYSTEM --- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column; 
    height: 100vh;          
    flex-wrap: nowrap;      
}

main {
    flex-grow: 1;
    padding: 30px 0;
    overflow: auto;
}

main .main-limit {
    padding: 0 5%;
    max-width: 800px;
    margin: auto;
}

main p {
    line-height: 1.6;
    margin-bottom: 1.5em;
}

/* --- 2. HEADER INTERFACES --- */
header {
    background-color: #564ac1; 
    color: white;
    font-size: 1.2em;
}

header .header-container {
    max-width: 800px;
    margin: auto;
    padding: 20px 5%;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center; 
}

header .menu-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

header a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

header a button {
    background-color: white;
    color: #564ac1; 
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
}

header a button:hover {
    background-color: #3f3593;
    color: white;
}

/* --- 3. FORMULAR CONTROL SYSTEM --- */
.form-container {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
    border: 1px solid #e2e8f0;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: bold;
    color: #4a5568;
    font-size: 0.95em;
}

.form-group input {
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1em;
    background-color: #f8fafc;
    color: #334155;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-group input:focus {
    background-color: #ffffff;
    border-color: #564ac1;
    box-shadow: 0 0 0 3px rgba(86, 74, 193, 0.15);
    outline: none;
}

.form-group input::placeholder {
    color: #94a3b8;
}

#btnSubmit {
    background-color: #564ac1;
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(86, 74, 193, 0.2);
}

#btnSubmit:hover {
    background-color: #3f3593;
}

#btnSubmit:active {
    transform: scale(0.99);
}

/* --- 4. LIVE VALIDATION STATES (WinDev-Style) --- */
.error-message {
    display: none;
    color: #dc2626; 
    font-size: 0.85em;
    font-weight: bold;
    margin-top: 4px;
}

.form-group.has-error input {
    border-color: #dc2626;
    background-color: #fef2f2; 
}

.form-group.has-error .error-message {
    display: block;
}

#btnSubmit:disabled {
    background-color: #cbd5e1; 
    color: #94a3b8;
    cursor: not-allowed;       
    box-shadow: none;          
    transform: none;
}

/* --- 5. DATA PREVIEW AREA --- */
/* Links in der Liste */
main a {
    display: block;
    padding: 10px;
    background-color: white;
    margin: 10px 0;
    text-decoration: none;
    color: #2f286b;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

main a:hover {
    background-color: #564ac1;
    color: white;
}

main .preview-container {
    display: none; 
    margin-top: 25px;
    padding: 20px;
    background: #f0effb; 
    border-left: 5px solid #564ac1;
    border-radius: 4px 8px 8px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.preview-container h3 {
    margin-top: 0;
    color: #2f286b;
    font-size: 1.15em;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(86, 74, 193, 0.15);
    padding-bottom: 8px;
}

.preview-container p {
    margin: 8px 0;
    font-size: 0.95em;
    color: #475569;
}

.preview-container span {
    font-family: Consolas, Monaco, monospace; 
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- 6. WORKSHOP DESCRIPTION CARDS --- */
.workshop-lead {
    font-size: 1.1em;
    color: #1e293b;
    margin-bottom: 20px;
    border-left: 4px solid #3b82f6;
    padding-left: 12px;
}

.workshop-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.workshop-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.05em;
    color: #0f172a;
}

.workshop-card ul {
    margin: 0;
    padding-left: 20px;
}

.workshop-card li {
    margin-bottom: 8px;
    color: #334155;
}

.workshop-card li:last-child {
    margin-bottom: 0;
}

.security-alert {
    background-color: #f0fdf4; 
    border-color: #bbf7d0;
}

.security-alert h3 {
    color: #166534;
}

code {
    background-color: #e2e8f0;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    font-weight: bold;
}

.security-alert code {
    background-color: #dcfce7;
    color: #14532d;
}

/* Stilvolles Highlight für wichtige Begriffe im Text (z.B. FormData) */
.lightMark {
    background-color: #f0effb;       /* Dezentes, helles Lila passend zum Header */
    color: #564ac1;                  /* Deine lila Hauptfarbe */
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid rgba(86, 74, 193, 0.15);
    font-size: 0.95em;
    display: inline-block;
}

/* Optimierung für verschachtelte Listen in der Sicherheits-Karte */
.workshop-card ul ul {
    margin-top: 6px;
    margin-bottom: 4px;
    list-style-type: circle;          /* Ändert den Aufzählungspunkt für die 2. Ebene */
}

.workshop-card ul ul li {
    color: #475569;
    font-size: 0.95em;
}

/* --- 7. FOOTER INTERFACES --- */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px;      
}

/* --- 8. ADAPTIVE RESPONSIVE MEDIA QUERIES --- */
@media screen and (max-width: 550px) {
    header .header-container {
        padding: 15px 3%;
    }
    header a button {
        font-size: 0.85em;
        padding: 8px 14px;
    }
}

@media screen and (max-width: 420px) {
    header .header-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    header a button {
        font-size: 0.8em;
    }
}

@media screen and (max-width: 370px) {
    header .menu-container {
        flex-direction: column;
        width: 100%;
    }
    header .menu-container a, 
    header .menu-container button {
        width: 100%;
    }
}