/**
 * Frontend Styles - 5meter Portal Design
 * @package 5meter-Mitarbeitergespraeche
 */

/* ==========================================================================
   Variablen - 5meter Portal Design
   ========================================================================== */

:root {
    /* Portal Farben */
    --portal-primary: #6366f1;
    --portal-secondary: #8b5cf6;
    --portal-gradient-start: #667eea;
    --portal-gradient-end: #764ba2;
    
    /* Status-Farben */
    --fmg-success: #10b981;
    --fmg-warning: #f59e0b;
    --fmg-danger: #ef4444;
    --fmg-info: #3b82f6;
    
    /* Text & Backgrounds */
    --fmg-text: #1e293b;
    --fmg-text-light: #64748b;
    --fmg-text-muted: #94a3b8;
    --fmg-border: #e2e8f0;
    --fmg-bg: #f8fafc;
    --fmg-bg-card: #ffffff;
    --fmg-white: #fff;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Main Wrap - Portal Style
   ========================================================================== */

.fmg-ma-vorbereitung-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: var(--fmg-bg);
}

.fmg-error {
    padding: var(--spacing-lg);
    background: #fef2f2;
    border-left: 4px solid var(--fmg-danger);
    border-radius: var(--radius-lg);
    color: var(--fmg-danger);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Header - Portal Gradient
   ========================================================================== */

.fmg-header {
    padding: var(--spacing-xl) var(--spacing-xl);
    background: linear-gradient(135deg, var(--portal-gradient-start) 0%, var(--portal-gradient-end) 100%);
    color: var(--fmg-white);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.fmg-header h2 {
    margin: 0 0 var(--spacing-lg) 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--fmg-white);
    letter-spacing: -0.02em;
}

.fmg-termin-info {
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    font-size: 1rem;
    line-height: 1.8;
}

.fmg-termin-info strong {
    color: var(--fmg-white);
    font-weight: 600;
}

/* ==========================================================================
   Sections - Portal Card Style
   ========================================================================== */

.fmg-section {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl);
    background: var(--fmg-bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--fmg-border);
    transition: box-shadow 0.2s ease;
}

.fmg-section:hover {
    box-shadow: var(--shadow-lg);
}

.fmg-section h3 {
    margin: 0 0 var(--spacing-lg) 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fmg-text);
    padding-bottom: var(--spacing-md);
    border-bottom: 3px solid var(--portal-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.fmg-section h4 {
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--portal-primary);
}

.fmg-description {
    color: var(--fmg-text-light);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

/* ==========================================================================
   Bewertungs-Grid
   ========================================================================== */

.fmg-bewertung-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.fmg-bewertung-item {
    padding: 20px;
    background: var(--fmg-bg);
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.fmg-bewertung-item:hover {
    border-color: var(--fmg-primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.fmg-bewertung-item label {
    display: block;
    font-weight: 600;
    color: var(--fmg-text);
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.4;
}

.fmg-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fmg-ma-bewertung-input {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--fmg-border);
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--fmg-bg-card);
}

.fmg-ma-bewertung-input:focus {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--fmg-white);
}

.fmg-ma-bewertung-input:valid {
    border-color: var(--fmg-success);
    background: rgba(16, 185, 129, 0.05);
}

.fmg-unit {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fmg-text-muted);
}

/* ==========================================================================
   Textarea
   ========================================================================== */

.fmg-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--fmg-border);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: var(--fmg-white);
}

.fmg-textarea:focus {
    outline: none;
    border-color: var(--fmg-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.fmg-textarea::placeholder {
    color: #999;
}

/* ==========================================================================
   Save Status
   ========================================================================== */

.fmg-save-status {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: var(--fmg-white);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--fmg-success);
    transition: all 0.3s ease;
}

.fmg-save-status.saving {
    color: var(--fmg-warning);
    background: #fff3e0;
}

.fmg-save-status.error {
    color: var(--fmg-danger);
    background: #ffe5e5;
}

.fmg-save-status .dashicons {
    font-size: 20px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fmg-save-status.saving .dashicons {
    animation: pulse 1.5s infinite;
}

/* ==========================================================================
   Bonus Cards (Read-only View)
   ========================================================================== */

.fmg-bonus-result {
    background: linear-gradient(135deg, var(--fmg-primary) 0%, var(--fmg-secondary) 100%);
    color: var(--fmg-white);
    border: none;
}

.fmg-bonus-result h3 {
    color: var(--fmg-white);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.fmg-bonus-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.fmg-bonus-card {
    padding: 25px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    text-align: center;
    transition: all 0.3s ease;
}

.fmg-bonus-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px);
}

.fmg-bonus-card.fmg-total {
    background: rgba(255, 215, 0, 0.3);
    border: 2px solid #ffd700;
}

.fmg-bonus-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.fmg-bonus-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--fmg-white);
}

.fmg-bonus-amount {
    display: block;
    font-size: 16px;
    margin-top: 8px;
    opacity: 0.9;
}

/* ==========================================================================
   Read-only Bewertungstabelle
   ========================================================================== */

.fmg-bewertung-table-readonly {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: var(--fmg-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fmg-bewertung-table-readonly thead {
    background: linear-gradient(135deg, var(--fmg-primary) 0%, var(--fmg-secondary) 100%);
    color: var(--fmg-white);
}

.fmg-bewertung-table-readonly th,
.fmg-bewertung-table-readonly td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--fmg-border);
}

.fmg-bewertung-table-readonly th {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fmg-bewertung-table-readonly tbody tr:hover {
    background: var(--fmg-bg);
}

.fmg-bewertung-table-readonly tbody tr td:not(:first-child) {
    text-align: center;
    font-weight: 700;
    color: var(--fmg-primary);
}

.fmg-bewertung-table-readonly tbody tr td:last-child {
    font-size: 18px;
    color: var(--fmg-secondary);
}

/* ==========================================================================
   Content Box (Vereinbarungen)
   ========================================================================== */

.fmg-content {
    padding: 20px;
    background: var(--fmg-bg);
    border-radius: 8px;
    line-height: 1.8;
    color: var(--fmg-text);
}

/* ==========================================================================
   Historie & Widget
   ========================================================================== */

.fmg-historie-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.fmg-historie-wrap h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--fmg-text);
}

.fmg-historie-wrap ul {
    list-style: none;
    padding: 0;
}

.fmg-historie-wrap li {
    padding: 15px 20px;
    background: var(--fmg-white);
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid var(--fmg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.fmg-widget-naechstes-gespraech {
    padding: 20px;
    background: linear-gradient(135deg, var(--fmg-primary) 0%, var(--fmg-secondary) 100%);
    color: var(--fmg-white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.fmg-widget-naechstes-gespraech h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: var(--fmg-white);
}

.fmg-widget-naechstes-gespraech p {
    margin: 5px 0;
    font-size: 16px;
}

.fmg-widget-empty {
    padding: 20px;
    background: var(--fmg-bg);
    border-radius: 8px;
    text-align: center;
    color: var(--fmg-text-light);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .fmg-ma-vorbereitung-wrap {
        padding: 10px;
    }
    
    .fmg-header {
        padding: 25px 20px;
    }
    
    .fmg-header h2 {
        font-size: 24px;
    }
    
    .fmg-section {
        padding: 20px;
    }
    
    .fmg-section h3 {
        font-size: 20px;
    }
    
    .fmg-bewertung-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .fmg-bonus-cards {
        grid-template-columns: 1fr;
    }
    
    .fmg-save-status {
        bottom: 15px;
        right: 15px;
        left: 15px;
        justify-content: center;
    }
    
    .fmg-bewertung-table-readonly {
        font-size: 13px;
    }
    
    .fmg-bewertung-table-readonly th,
    .fmg-bewertung-table-readonly td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .fmg-header h2 {
        font-size: 20px;
    }
    
    .fmg-termin-info {
        font-size: 14px;
    }
    
    .fmg-bonus-value {
        font-size: 28px;
    }
    
    .fmg-bewertung-table-readonly {
        display: block;
        overflow-x: auto;
    }
}

/* ==========================================================================
   Loading Animation
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fmg-section {
    animation: fadeIn 0.5s ease-out;
}

.fmg-section:nth-child(1) { animation-delay: 0.1s; }
.fmg-section:nth-child(2) { animation-delay: 0.2s; }
.fmg-section:nth-child(3) { animation-delay: 0.3s; }
.fmg-section:nth-child(4) { animation-delay: 0.4s; }

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .fmg-save-status {
        display: none;
    }
    
    .fmg-header {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .fmg-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
