/* ============================================
   Captive Portal - Separate CSS-Datei
   ============================================ */

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
}

body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Container für das gesamte Formular */
.captive-container {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Logo */
.logo {
    display: block;
    max-width: 200px;
    height: auto;
    margin: 0 auto 30px;
}

.logo.responsive {
    width: 100%;
    max-width: 200px;
}

/* Überschrift */
h1 {
    font-size: 28px;
    text-align: center;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 600;
}

h2 {
    font-size: 18px;
    text-align: center;
    color: #666;
    margin: 0 0 30px 0;
    font-weight: 400;
}

/* Formular */
form {
    width: 100%;
}

/* Floating Label Input */
.floating-label {
    position: relative;
    margin-bottom: 20px;
}

.floating-label input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
}

.floating-label input:focus {
    border-color: #DD3333;
    box-shadow: 0 0 0 3px rgba(221, 51, 51, 0.1);
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    top: -10px;
    left: 12px;
    font-size: 12px;
    color: #DD3333;
    background: white;
    padding: 0 6px;
}

.floating-label label {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 16px;
    color: #999;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
}

.floating-label input::placeholder {
    color: transparent;
}

/* Button */
button[type="submit"],
.btn-primary {
    width: 100%;
    padding: 14px;
    background: #DD3333;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

button[type="submit"]:hover,
.btn-primary:hover {
    background: #C02A2A;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(221, 51, 51, 0.3);
}

button[type="submit"]:active,
.btn-primary:active {
    transform: translateY(0);
}

/* Ergebnisse */
.results-container {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e1e5e9;
}

.results-container h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
}

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

.location-item {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    transition: all 0.2s ease;
    cursor: pointer;
}

.location-item:hover {
    border-color: #DD3333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.location-item strong {
    color: #DD3333;
    font-size: 16px;
}

.location-item .subdomain {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

/* Fehlermeldung / Keine Treffer */
.message {
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
}

.message.error,
.message.no-results {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
}

.message.success {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.message h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.message p {
    margin: 0 0 15px 0;
    font-size: 16px;
    line-height: 1.5;
}

/* Link */
.btn-link {
    display: inline-block;
    padding: 12px 24px;
    background: #DD3333;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-link:hover {
    background: #C02A2A;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(221, 51, 51, 0.3);
}

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

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 16px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ============================================
   Login Container (login.php)
   ============================================ */
.login-container {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    padding-top: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-container .logo.responsive {
    max-width: 200px;
    width: 100%;
    height: auto;
    padding-top: 10px;
}

/* Floating Label: Icon-Variante */
.floating-label.with-icon input {
    padding-left: 44px;
}

.floating-label.with-icon label {
    left: 44px;
}

.floating-label.with-icon input:focus + label,
.floating-label.with-icon input:not(:placeholder-shown) + label {
    left: 12px;
}

.floating-label.with-icon .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.floating-label.with-icon input:focus ~ .icon {
    opacity: 1;
}

/* Floating Label: Toggle-Variante (Passwort) */
.floating-label.with-toggle input {
    padding-right: 48px;
}

.floating-label.with-icon.with-toggle input {
    padding-left: 44px;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    width: auto;
    min-width: auto;
}

.password-toggle:hover {
    opacity: 1;
}

.password-toggle span {
    font-size: 18px;
}

/* ============================================
   Activity Overview - Dashboard Cards
   ============================================ */
.page-header {
    max-width: 1400px;
    margin: 0 auto 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    text-align: center;
}

.page-header .logout-link {
    color: #DD3333;
    text-decoration: none;
    font-size: 14px;
}

.page-header .logout-link:hover {
    text-decoration: underline;
}

.dashboard-cards {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card.clickable-card {
    cursor: pointer;
}

.dashboard-card.clickable-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.dashboard-card-icon {
    width: 100px;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.dashboard-card-icon.icon-ok { background: #d1fae5; }
.dashboard-card-icon.icon-warn { background: #fef3c7; }
.dashboard-card-icon.icon-error { background: #fee2e2; }

.dashboard-card-body {
    flex: 1;
    padding: 20px 24px;
}

.dashboard-card-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}

.dashboard-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.subdomain-badge {
    display: inline-block;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-top: 4px;
    width: fit-content;
}

.dashboard-card-content {
    margin-top: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: #6b7280;
}

.stat-value {
    font-weight: 600;
    color: #1f2937;
}

.stat-value.online {
    color: #10b981;
}

.stat-value.error {
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .captive-container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 16px;
    }
    
    .floating-label input {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .captive-container,
    .login-container {
        padding: 25px 15px;
    }
    
    .logo {
        max-width: 150px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        flex-direction: column;
    }

    .dashboard-card-icon {
        width: 100%;
        min-height: 60px;
    }
}

