/* ===== DASHBOARD - MODERN INDIGO/PURPLE STYLE ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #a78bfa;
    --bg-dark: #0a0a0f;
    --bg-lighter: #14141f;
    --bg-card: #1a1a2e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #2d2d44;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #64748b;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 40px rgba(99, 102, 241, 0.4);
}

html, body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #14141f 100%);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== DASHBOARD ===== */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    padding: 40px 24px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    position: relative;
}

.header h1 {
    font-size: 42px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #818cf8 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
    font-weight: 900;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.4));
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ===== ADMIN LOGIN BUTTON ===== */
.btn-admin-login {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn-admin-login:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-admin-login.logged-in {
    background: linear-gradient(135deg, var(--success), #059669);
    border-color: var(--success);
    color: white;
}

.btn-admin-login.logged-in:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 32px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ===== PROJECTS GRID - ZENTRIERT ===== */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    animation: fadeIn 0.5s ease;
}

/* ===== PROJECT CARD ===== */
.project-card {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 380px;
    min-width: 320px;
}

.project-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

/* ===== PROJECT HEADER ===== */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.project-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ===== STATUS BADGE ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.status-badge.online {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.sleeping {
    background-color: rgba(100, 116, 139, 0.15);
    color: var(--info);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.status-badge.starting {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-badge.error {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===== PROJECT INFO ===== */
.project-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(10, 10, 15, 0.6);
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.2s ease;
}

.info-row:hover {
    background: rgba(10, 10, 15, 0.8);
    border-color: rgba(99, 102, 241, 0.3);
}

.info-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    color: var(--primary-light);
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
}

.project-url .info-value {
    word-break: break-all;
    text-align: right;
}

/* ===== BUTTONS ===== */
.project-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #4338ca);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-restart {
    background: linear-gradient(135deg, var(--warning), #f59e0b);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-restart:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.6);
}

.btn-restart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== FOOTER ===== */
.footer {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(99, 102, 241, 0.3);
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

/* ===== LOADING ===== */
.loading {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

/* ===== LOGIN MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.visible {
    display: flex;
}

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(30px);
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.btn-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 28px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(10, 10, 15, 1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.error-message {
    color: var(--error);
    font-size: 13px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.btn-block {
    width: 100%;
}

/* ===== NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 16px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.notification-success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.notification-error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* ===== RESPONSIVE - MOBILE OPTIMIERT ===== */

/* Tablet (768px) */
@media (max-width: 768px) {
    .header {
        padding: 30px 20px 30px 20px;
    }

    .btn-admin-login {
        position: static;
        margin: 16px auto 0;
        display: block;
        max-width: 200px;
    }

    .header h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 13px;
    }

    .main-content {
        padding: 24px 16px;
    }

    .projects-grid {
        gap: 20px;
    }

    .project-card {
        padding: 20px;
        max-width: 100%;
        min-width: auto;
    }

    .project-name {
        font-size: 20px;
    }

    .info-row {
        padding: 9px 12px;
        font-size: 12px;
    }

    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }

    .notification.show {
        transform: translateY(0);
    }
}

/* Mobile Portrait (480px) */
@media (max-width: 480px) {
    .header {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 28px;
        letter-spacing: -0.01em;
    }

    .subtitle {
        font-size: 12px;
    }

    .main-content {
        padding: 20px 12px;
    }

    .projects-grid {
        gap: 16px;
    }

    .project-card {
        padding: 16px;
        border-radius: 16px;
    }

    .project-header {
        flex-direction: column;
        align-items: start;
        gap: 10px;
    }

    .project-name {
        font-size: 18px;
    }

    .status-badge {
        font-size: 11px;
        padding: 5px 12px;
    }

    .project-info {
        gap: 8px;
    }

    .info-row {
        flex-direction: column;
        gap: 6px;
        padding: 10px 12px;
        font-size: 12px;
    }

    .info-label {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .info-value {
        font-size: 13px;
    }

    .project-url .info-value {
        text-align: left;
    }

    .project-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        width: 100%;
        padding: 11px 18px;
        font-size: 13px;
    }

    .footer {
        padding: 16px 12px;
        font-size: 11px;
    }

    .spinner {
        width: 40px;
        height: 40px;
    }

    .modal-content {
        width: 95%;
        max-width: none;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-body {
        padding: 20px;
    }
}

/* Sehr kleine Displays (360px) */
@media (max-width: 360px) {
    .header h1 {
        font-size: 24px;
    }

    .project-card {
        padding: 14px;
    }

    .project-name {
        font-size: 16px;
    }

    .info-row {
        padding: 8px 10px;
    }
}