/* ==========================================================================
   WSG Datanorm Import Tool - Main Stylesheet
   Corporate Colors: Orange (#f39c12, #e67e22) & Gray (#2c3e50, #7f8c8d)
   ========================================================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* Prevent text selection */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    user-select: none; /* Prevent text selection */
}

/* ==========================================================================
   Color Variables (WSG Corporate Colors)
   ========================================================================== */
:root {
    --primary-orange: #f39c12;
    --secondary-orange: #e67e22;
    --primary-gray: #2c3e50;
    --secondary-gray: #7f8c8d;
    --header-gray: #4a5f72;
    --light-gray: #bdc3c7;
    --bg-gray: #f8f9fa;
    --border-gray: #e9ecef;
    --success-green: #27ae60;
    --warning-yellow: #f1c40f;
    --danger-red: #e74c3c;
    --info-blue: #3498db;
}

/* ==========================================================================
   Login Pages (Welcome & Admin)
   ========================================================================== */
.login-page {
    background: linear-gradient(135deg, #5a6c7d 0%, #95a5a6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: transparent;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    margin: 20px;
}

.login-header {
    background: var(--header-gray);
    color: white;
    padding: 30px 30px 20px;
    text-align: center;
    border-radius: 17px 17px 0 0;
}

.login-header.admin {
    background: var(--header-gray);
    border: 3px solid var(--danger-red);
    border-radius: 17px 17px 0 0;
    border-bottom: none;
}

.logo {
    width: 320px;
    height: auto;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 600;
}

.login-header.admin h1 {
    font-size: 26px;
    font-weight: 700;
}

.login-header p {
    opacity: 0.9;
    font-size: 14px;
}

.admin-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    margin-top: 10px;
    font-weight: 600;
}

.form-container {
    background: white;
    padding: 40px 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-gray);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    font-size: 16px;
    color: var(--primary-gray);
    text-align: center;
    transition: border-color 0.3s ease;
}

.form-group input::placeholder {
    color: #bdc3c7;
    opacity: 0.7;
    text-align: center;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
    text-align: center;
}

.form-group.admin input:focus {
    border-color: var(--danger-red);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
    text-align: center;
}

.form-group.admin input::placeholder {
    color: #bdc3c7;
    opacity: 0.6;
    text-align: center;
}

.login-btn {
    width: 100%;
    background: var(--primary-orange);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn.admin {
    background: var(--danger-red);
}

.login-btn:hover {
    transform: translateY(-2px);
    background: var(--secondary-orange);
    box-shadow: 0 10px 20px rgba(243, 156, 18, 0.3);
}

.login-btn.admin:hover {
    background: #c0392b;
    box-shadow: 0 10px 20px rgba(231, 76, 60, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.status-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.features {
    background: var(--bg-gray);
    padding: 20px 30px;
    border-top: 1px solid var(--border-gray);
}

.features h3 {
    color: var(--primary-gray);
    margin-bottom: 15px;
    font-size: 16px;
}

.features ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.features li {
    margin-bottom: 8px;
    color: var(--secondary-gray);
    font-size: 14px;
    display: flex;
    align-items: center;
}

.features li::before {
    content: '✅';
    margin-right: 10px;
}

.back-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-gray);
}

.back-link a {
    color: var(--secondary-gray);
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.back-link a:hover {
    text-decoration: underline;
    color: var(--primary-gray);
}

.wsg-branding {
    background: var(--header-gray);
    color: #ecf0f1;
    padding: 10px 30px;
    text-align: center;
    font-size: 12px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wsg-branding a {
    color: var(--primary-orange);
    text-decoration: none;
}

.admin-gear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.2s ease;
    user-select: none;
    z-index: 1;
}

.admin-gear:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* ==========================================================================
   Admin Dashboard
   ========================================================================== */
.admin-body {
    background: linear-gradient(135deg, #5a6c7d 0%, #95a5a6 100%);
    color: var(--primary-gray);
    min-height: 100vh;
}

.header {
    background: var(--danger-red);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-icon {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.user-icon:hover {
    background: rgba(255,255,255,0.3);
}

.user-icon svg {
    fill: white;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--primary-gray);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: var(--bg-gray);
    color: var(--primary-orange);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-orange);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-orange);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--secondary-gray);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.actions-section,
.users-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-gray);
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-gray);
}

.users-table th {
    background: var(--bg-gray);
    font-weight: 600;
    color: var(--primary-gray);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: var(--primary-orange);
    color: white;
}

.btn-success {
    background: var(--primary-orange);
    color: white;
}

.btn-warning {
    background: var(--primary-orange);
    color: white;
}

.btn-danger {
    background: var(--danger-red);
    color: white;
}

.btn-orange {
    background: var(--primary-orange);
    color: white;
}

.btn-info {
    background: var(--primary-orange);
    color: white;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .admin-info {
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons {
        flex-direction: column;
    }

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

@media (max-width: 480px) {
    .login-container {
        margin: 10px;
    }
    
    .login-header {
        padding: 25px 20px 15px;
    }
    
    .form-container {
        padding: 30px 20px;
    }

    .logo {
        width: 100px;
    }

    .container {
        padding: 20px 10px;
    }

    .users-table {
        font-size: 12px;
    }

    .users-table th,
    .users-table td {
        padding: 8px 4px;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

/* Email section styles */
.email-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.email-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.status-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.status-value {
    font-weight: 500;
    color: #6c757d;
    font-size: 14px;
}

.status-value.status-success {
    color: #155724;
    font-weight: 600;
}

.status-value.status-error {
    color: #721c24;
    font-weight: 600;
}

.email-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.email-actions .btn {
    flex: 0 0 auto;
}

/* ==========================================================================
   Custom Dialog & Toast System
   ========================================================================== */

/* Toast Notifications (rechts oben) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    padding: 16px 20px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    transform: translateX(100%);
    opacity: 0;
}

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

.toast.success {
    border-left-color: var(--success-green);
}

.toast.error {
    border-left-color: var(--danger-red);
}

.toast.warning {
    border-left-color: var(--warning-yellow);
}

.toast.info {
    border-left-color: var(--info-blue);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-green);
}

.toast.error .toast-icon {
    color: var(--danger-red);
}

.toast.warning .toast-icon {
    color: var(--warning-yellow);
}

.toast.info .toast-icon {
    color: var(--info-blue);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--primary-gray);
}

.toast-message {
    font-size: 13px;
    color: var(--secondary-gray);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--secondary-gray);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.toast-close:hover {
    background: rgba(0,0,0,0.1);
}

/* Custom Dialog System */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dialog-overlay.show {
    opacity: 1;
    visibility: visible;
}

.dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.dialog-overlay.show .dialog {
    transform: scale(1);
}

.dialog-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dialog-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.dialog.success .dialog-icon {
    color: var(--success-green);
}

.dialog.error .dialog-icon {
    color: var(--danger-red);
}

.dialog.warning .dialog-icon {
    color: var(--warning-yellow);
}

.dialog.info .dialog-icon {
    color: var(--info-blue);
}

.dialog.confirm .dialog-icon {
    color: var(--warning-yellow);
}

.dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-gray);
    flex: 1;
}

.dialog-body {
    padding: 20px 25px;
}

.dialog-message {
    color: var(--secondary-gray);
    line-height: 1.5;
    margin-bottom: 20px;
}

.dialog-footer {
    padding: 15px 25px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.dialog-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dialog-btn.primary {
    background: var(--info-blue);
    color: white;
}

.dialog-btn.primary:hover {
    background: #2980b9;
}

.dialog-btn.success {
    background: var(--success-green);
    color: white;
}

.dialog-btn.success:hover {
    background: #229954;
}

.dialog-btn.danger {
    background: var(--danger-red);
    color: white;
}

.dialog-btn.danger:hover {
    background: #c0392b;
}

.dialog-btn.secondary {
    background: var(--bg-gray);
    color: var(--secondary-gray);
    border: 1px solid var(--border-gray);
}

.dialog-btn.secondary:hover {
    background: #e9ecef;
}

/* Back Button Component */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-gray);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
    margin-bottom: 20px;
}

.back-button:hover {
    background: var(--bg-gray);
    color: var(--primary-gray);
    text-decoration: none;
}

.back-button-icon {
    font-size: 16px;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Navigation Tabs (SPA-like experience)
   ========================================================================== */
.nav-tabs {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.nav-tab {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: var(--bg-gray);
    color: var(--secondary-gray);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-tab:hover {
    background: #e9ecef;
    color: var(--primary-gray);
}

.nav-tab.active {
    background: white;
    color: var(--primary-orange);
    border-bottom-color: var(--primary-orange);
}

.nav-tab:first-child {
    border-radius: 8px 0 0 8px;
}

.nav-tab:last-child {
    border-radius: 0 8px 8px 0;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    background-color: #ffffff;
    padding: 25px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab-content.active {
    display: block;
}

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

/* Custom blocked screen styles (separate from form-container to avoid conflicts) */
.blocked-screen,
.admin-locked-screen {
    background: white;
    padding: 0;
    border-radius: 0;
}

.blocked-screen > div,
.admin-locked-screen > div {
    background: white;
    padding: 40px 20px;
}

.security-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
}

.session-info-box ul li strong {
    color: var(--primary-gray);
}

/* Online Users List in Session Tab */
#onlineUsersListContainer {
    margin-top: 0;
    padding: 0;
}

#onlineUsersListContainer h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-gray);
    border-bottom: 2px solid var(--primary-orange);
    padding-bottom: 10px;
}

#onlineUsersList {
    background: #fff;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 20px;
    min-height: 100px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#onlineUsersList .user-entry {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-gray);
}

#onlineUsersList .user-entry:last-child {
    border-bottom: none;
}

#onlineUsersList .user-icon-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-orange);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    font-size: 14px;
}

#onlineUsersList .user-details strong {
    display: block;
    color: var(--primary-gray);
    font-size: 15px;
}

#onlineUsersList .user-details small {
    color: var(--secondary-gray);
    font-size: 13px;
}

#onlineUsersList p {
    color: var(--secondary-gray);
}

/* Spezifische Sektionen innerhalb eines Tabs */
.sessions-section, 
.security-section,
.email-section,
.users-section, 
.actions-section {
    background: #f8f9fa;
    border: 1px solid var(--border-gray);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.sessions-section .section-title,
.security-section .section-title,
.email-section .section-title,
.users-section .section-title,
.actions-section .section-title {
    border-bottom: 2px solid var(--primary-orange);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

/* Verbesserte Session Info Box */
.session-info-box {
    background-color: #e9ecef;
    padding: 20px;
    border-radius: 6px;
    margin-top: 30px;
}

.session-info-box h3 {
    color: var(--primary-gray);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 8px;
}

.session-info-box ul {
    list-style: none;
    padding-left: 0;
}

.session-info-box ul li {
    margin-bottom: 10px;
    color: var(--secondary-gray);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
}

.session-info-box ul li::before {
    content: '✓';
    color: var(--success-green);
    margin-right: 10px;
    font-weight: bold;
} 