/* Slot Template Global Styles */

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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
#main-nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Component Slot */
#component-slot {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    font-size: 1.2rem;
    color: #94a3b8;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    margin-left: 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error State */
.error-message {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.error-message h2 {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.error-message p {
    color: #64748b;
    margin-bottom: 2rem;
}

.error-message button {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.error-message button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 80px;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

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

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

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

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

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

.login-error {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Dashboard */
.dashboard {
    text-align: center;
    padding: 3rem 1rem;
}

.dashboard h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.dashboard > p {
    color: #64748b;
    margin-bottom: 2.5rem;
}

.dashboard-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 260px;
    cursor: pointer;
    transition: all 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.dashboard-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.dashboard-card p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }

    #component-slot {
        padding: 1rem;
    }

    #toast-container {
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
    }
}
