/* RudiMentAIr Dashboard NEU - Einheitliches Design */
/* Basis: Dark Theme mit Apple-inspiriertem Clean-Design */

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(30, 41, 59, 0.6);
    --border-color: rgba(148, 163, 184, 0.2);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-color: rgba(148, 163, 184, 0.3);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.05);
    background: var(--bg-card);
}

.theme-toggle .icon-light { display: none; }
.theme-toggle .icon-dark { display: block; }

[data-theme="light"] .theme-toggle .icon-light { display: block; }
[data-theme="light"] .theme-toggle .icon-dark { display: none; }

/* ===== Background Animation ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* ===== Public Page Styles ===== */
.public-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.public-container {
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.public-container .brand {
    margin-bottom: 3rem;
}

.public-container .brand .logo {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.public-container .brand h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.public-container .brand .subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ===== Section Styles ===== */
.section {
    margin-bottom: 2rem;
}

.section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Public Section */
.public-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(10px);
}

/* Links Grid */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

.link-card:hover {
    transform: translateY(-2px);
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.link-card .link-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.link-card .link-info {
    text-align: left;
}

.link-card .link-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.link-card .link-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: var(--text-muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== Login Section ===== */
.login-section {
    display: flex;
    justify-content: center;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Features Preview */
.features-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.feature-icon {
    font-size: 1.25rem;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-large {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Register Hint */
.register-hint {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.register-hint a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.register-hint a:hover {
    text-decoration: underline;
}

/* ===== Login Page Styles ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-container .brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-container .brand .logo {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
}

.login-container .brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-container .brand .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Back Button */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    z-index: 100;
}

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

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

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

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.forgot-password {
    color: var(--accent-primary);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #ef4444;
    font-size: 0.875rem;
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    padding: 0 1rem;
}

/* Register Link */
.register-link {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.register-link a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

/* ===== Dashboard/Portal Styles ===== */
.dashboard-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-small {
    font-size: 1.75rem;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.clock {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Main Content */
.dashboard-main {
    flex: 1;
    padding: 6rem 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 2.5rem;
}

.welcome-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-section .date {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Apps Section */
.apps-section {
    margin-bottom: 2.5rem;
}

.apps-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--app-color, var(--accent-primary));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.app-card:hover {
    transform: translateY(-2px);
    background: var(--bg-secondary);
    border-color: var(--app-color, var(--accent-primary));
    box-shadow: var(--shadow-lg);
}

.app-card:hover::before {
    opacity: 1;
}

.app-card .app-icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.app-card .app-info {
    flex: 1;
    min-width: 0;
}

.app-card .app-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.app-card .app-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-status {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.status-active { color: #10b981; }
.status-new { color: #3b82f6; }
.status-dev { color: #f59e0b; }

/* Quick Actions */
.quick-actions-section {
    margin-bottom: 2.5rem;
}

.quick-actions-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.action-btn .action-icon {
    font-size: 1.25rem;
}

/* Footer */
.dashboard-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
}

.dashboard-footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.dashboard-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.dashboard-footer a:hover {
    text-decoration: underline;
}

.version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Public Footer */
.public-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.public-footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.public-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.public-footer a:hover {
    text-decoration: underline;
}

/* Login Footer */
.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.login-footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .public-page,
    .login-page {
        padding: 1rem;
    }

    .public-container .brand .logo {
        font-size: 3rem;
    }

    .public-container .brand h1 {
        font-size: 1.75rem;
    }

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

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

    .dashboard-header {
        padding: 0.75rem 1rem;
    }

    .header-left h1 {
        display: none;
    }

    .clock {
        display: none;
    }

    .dashboard-main {
        padding: 5rem 1rem 1rem;
    }

    .welcome-section h2 {
        font-size: 1.5rem;
    }

    .actions-grid {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .app-card {
        padding: 1rem;
    }

    .app-card .app-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.app-card {
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.15s; }
.app-card:nth-child(3) { animation-delay: 0.2s; }
.app-card:nth-child(4) { animation-delay: 0.25s; }
.app-card:nth-child(5) { animation-delay: 0.3s; }
.app-card:nth-child(6) { animation-delay: 0.35s; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
