/* Familjens Hemsida - Mörkt professionellt tema */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --radius: 8px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.5;
    padding: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface);
    min-height: 100vh;
    padding: 24px;
}

/* Login Indikator */
.login-indicator {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.login-btn, .admin-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.login-btn:hover, .admin-link:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.login-btn.logged-in {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.admin-link {
    background: var(--warning);
    color: #0f172a;
    border-color: var(--warning);
}

.icon {
    width: 16px;
    height: 16px;
}

/* Header */
.site-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.site-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Kategorier */
.category {
    margin-bottom: 32px;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-icon {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
}

/* App Grid */
.apps-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    cursor: pointer;
}

.app-card:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.app-card.requires-login.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.app-icon {
    font-size: 1.5rem;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

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

.app-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text);
}

.app-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.app-badge.public {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-light);
}

.app-badge.private {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

/* Formulär */
.auth-view h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

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

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

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text);
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.form-group.checkbox {
    display: flex;
    align-items: center;
}

.form-group.checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.form-group.checkbox input {
    width: auto;
}

/* Knappar */
.btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.form-links {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.form-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-links a:hover {
    text-decoration: underline;
}

/* Meddelanden */
.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Responsiv design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .site-header {
        margin-bottom: 24px;
    }
    
    .login-indicator {
        top: 12px;
        right: 12px;
    }
    
    .category {
        margin-bottom: 24px;
    }
    
    .modal-content {
        padding: 24px;
    }
    
    .app-description {
        display: none;
    }
}
