/**
 * Frontend CSS für Mühlentagebuch Plugin
 * Version: 1.4.0
 */

/* === BASIS-STYLES === */
.muehlentagebuch-login-form,
.muehlentagebuch-login-status,
.muehlentagebuch-dashboard,
.muehlentagebuch-entry-form {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
}

/* === LOGIN-FORMULAR === */
.muehlentagebuch-login-form {
    max-width: 400px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8e8e8;
}

.muehlentagebuch-login-form .form-group {
    margin-bottom: 20px;
}

.muehlentagebuch-login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.muehlentagebuch-login-form input[type="text"],
.muehlentagebuch-login-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.muehlentagebuch-login-form input[type="text"]:focus,
.muehlentagebuch-login-form input[type="password"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.2);
}

.muehlentagebuch-login-form input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.2);
}

.muehlentagebuch-login-form .button {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.muehlentagebuch-login-form .button:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.muehlentagebuch-login-form .button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* === LOGIN-STATUS === */
.muehlentagebuch-login-status {
    max-width: 400px;
    margin: 30px auto;
    padding: 20px;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.2);
}

.muehlentagebuch-login-status p {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.muehlentagebuch-login-status .button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.muehlentagebuch-login-status .button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* === MESSAGE-SYSTEM === */
#login-message,
.form-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    transition: all 0.3s ease;
}

#login-message.success,
.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#login-message.error,
.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.field-error {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

/* === DASHBOARD === */
.muehlentagebuch-dashboard {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
}

.muehlentagebuch-dashboard h3 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-box {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border-left: 5px solid #3498db;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-box h4 {
    margin: 0 0 15px 0;
    color: #7f8c8d;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 2.5em;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 10px;
    line-height: 1;
}

.stat-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.dashboard-actions {
    text-align: center;
    margin: 30px 0;
}

.dashboard-actions .button {
    margin: 0 10px 10px 0;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.dashboard-actions .button-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
}

.dashboard-actions .button-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.dashboard-actions .button:not(.button-primary) {
    background: #ecf0f1;
    color: #2c3e50;
    border: 2px solid #bdc3c7;
}

.dashboard-actions .button:not(.button-primary):hover {
    background: #d5dbdb;
    border-color: #95a5a6;
}

/* === ENTRY FORM === */
.muehlentagebuch-entry-form {
    max-width: 900px;
    margin: 30px auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.entry-form-modern {
    padding: 40px;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h4 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

.form-section h4:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 2px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.form-field {
    margin-bottom: 25px;
}

.form-field label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.form-field label.required::after {
    content: ' *';
    color: #e74c3c;
    font-weight: 700;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    background: #fff;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
}

.field-hint {
    color: #7f8c8d;
    font-size: 12px;
    margin-top: 6px;
    display: block;
    font-style: italic;
}

/* === CHECKBOX STYLING === */
.checkbox-container,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.checkbox-container:hover,
.checkbox-label:hover {
    background: rgba(52, 152, 219, 0.05);
}

.form-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3498db;
}

/* === KORN-SEKTION === */
.korn-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.korn-eintrag-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    position: relative;
    transition: all 0.3s ease;
}

.korn-eintrag-card:hover {
    border-color: #3498db;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.1);
}

.korn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.korn-header select {
    flex: 1;
    margin-right: 20px;
    font-weight: 600;
}

.remove-korn-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.remove-korn-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
}

.korn-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.add-korn-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.add-korn-btn:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* === KOMPONENTEN-GRID === */
.komponenten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.komponente-checkbox {
    display: flex;
    align-items: center;
    padding: 15px 18px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 12px;
}

.komponente-checkbox:hover {
    border-color: #3498db;
    background: linear-gradient(135deg, #ebf3fd, #d6eaf8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.15);
}

.komponente-checkbox input:checked + .checkmark + .komponente-name {
    font-weight: 700;
    color: #2980b9;
}

.komponente-checkbox input:checked {
    accent-color: #3498db;
}

.komponente-name {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
}

.status-indicator {
    font-size: 16px;
    margin-left: auto;
}

.status-indicator.active { 
    color: #27ae60; 
    text-shadow: 0 0 10px rgba(39, 174, 96, 0.3);
}
.status-indicator.repair { 
    color: #f39c12; 
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}
.status-indicator.inactive { 
    color: #95a5a6; 
}

/* === FORM ACTIONS === */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #ecf0f1;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.3);
}

.btn:disabled {
    background: #bdc3c7 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-icon {
    font-size: 18px;
}

/* === RECENT ENTRIES === */
.recent-entries {
    margin-top: 30px;
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.recent-entries h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.entries-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.entry-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 18px;
    border-radius: 10px;
    border-left: 5px solid #3498db;
    transition: all 0.3s ease;
}

.entry-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.entry-date {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 600;
}

.entry-status {
    font-size: 20px;
}

.status-einsatzbereit { 
    color: #27ae60; 
    text-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}
.status-eingeschraenkt_einsatzbereit { 
    color: #f39c12; 
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}
.status-nicht_einsatzbereit { 
    color: #e74c3c; 
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.entry-content {
    margin-bottom: 10px;
}

.entry-content strong {
    color: #2c3e50;
    font-size: 16px;
}

.mahlbetrieb-badge {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    color: #27ae60;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 12px;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.entry-meta {
    font-size: 12px;
    color: #95a5a6;
    font-style: italic;
}

/* === NOTIFICATIONS === */
.muehlentagebuch-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: #fff;
    z-index: 9999;
    max-width: 400px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-weight: 500;
}

.notification-success {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.notification-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.notification-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* === LOADING STATES === */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
}

.loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ecf0f1;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .muehlentagebuch-login-form,
    .muehlentagebuch-dashboard,
    .muehlentagebuch-entry-form {
        margin: 15px;
        padding: 20px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-actions {
        flex-direction: column;
        gap: 15px;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .komponenten-grid {
        grid-template-columns: 1fr;
    }

    .korn-details {
        grid-template-columns: 1fr;
    }

    .entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .muehlentagebuch-notification {
        left: 15px;
        right: 15px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .entry-form-modern {
        padding: 20px;
    }

    .form-section h4 {
        font-size: 18px;
    }

    .stat-number {
        font-size: 2em;
    }

    .korn-header {
        flex-direction: column;
        gap: 15px;
    }

    .korn-header select {
        margin-right: 0;
        width: 100%;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === PRINT STYLES === */
@media print {
    .muehlentagebuch-dashboard,
    .muehlentagebuch-entry-form {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }

    .dashboard-actions,
    .form-actions,
    .remove-korn-btn,
    .add-korn-btn {
        display: none !important;
    }

    .form-control,
    .komponente-checkbox {
        border: 1px solid #ddd !important;
        background: transparent !important;
    }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    .muehlentagebuch-login-form,
    .muehlentagebuch-dashboard,
    .muehlentagebuch-entry-form,
    .recent-entries {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .form-control {
        background: #34495e;
        border-color: #4a6072;
        color: #ecf0f1;
    }

    .form-control:focus {
        background: #3d566e;
    }

    .korn-eintrag-card,
    .entry-item,
    .komponente-checkbox {
        background: linear-gradient(135deg, #34495e, #2c3e50);
        border-color: #4a6072;
    }

    .form-section h4,
    .recent-entries h4 {
        color: #ecf0f1;
    }

    /* 22.6.2025 */
    /* === BILD-UPLOAD STYLES === */
.upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
    margin-bottom: 15px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #3498db;
    background: #e8f4f8;
}

.upload-placeholder {
    padding: 20px;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.7;
}

.upload-placeholder p {
    margin: 10px 0;
    color: #7f8c8d;
    font-size: 16px;
}

#image-preview-container {
    margin-top: 20px;
    text-align: left;
}

#image-preview-container h5 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#image-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.image-preview-item {
    position: relative;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.image-preview-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.image-preview-item .image-info {
    padding: 8px;
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-item .remove-image:hover {
    background: #c0392b;
}

/* Responsive Design für Upload */
@media (max-width: 768px) {
    #image-preview-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .image-preview-item img {
        height: 60px;
    }
    
    .upload-icon {
        font-size: 2em;
    }
}
}