/* ===== COMPONENTS - MODERNARE KOMPONENTER SOM MATCHAR NYA ADMIN-DESIGNEN ===== */

/* ===============================================
   KNAPPAR - MODERN DESIGN
   =============================================== */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 101, 101, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(72, 187, 120, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Full-bredd knapp */
.btn-block {
    width: 100%;
    display: block;
}

/* ===============================================
   FORMULÄR
   =============================================== */

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
    color: #2d3748;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #cbd5e0;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
}

/* Input med ikon */
.form-group-icon {
    position: relative;
}

.form-group-icon input {
    padding-left: 2.5rem;
}

.form-group-icon .icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

/* Form footer */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #718096;
    font-size: 0.9rem;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.form-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ===============================================
   KORT (CARDS)
   =============================================== */

.card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card h3 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

.card p {
    margin: 0.5rem 0;
    color: #718096;
    line-height: 1.6;
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.card-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Course Card - specifik för kurser */
.course-card {
    border-left: 4px solid #667eea;
}

.course-card:hover {
    transform: translateY(-2px);
}

/* ===============================================
   QUIZ-KOMPONENTER
   =============================================== */

.quiz-item {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.quiz-item:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.12);
    transform: translateY(-2px);
}

.quiz-item h4 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
}

.quiz-item p {
    margin: 0.5rem 0;
    color: #718096;
    line-height: 1.6;
}

.quiz-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.quiz-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* Quiz-frågor */
.quiz-question {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.quiz-question h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.2rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quiz-option {
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.quiz-option:hover {
    border-color: #667eea;
    background: #f7faff;
}

.quiz-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f7faff 0%, #ebf4ff 100%);
}

/* ===============================================
   NAVBAR
   =============================================== */

.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.navbar h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-right span {
    font-weight: 600;
    color: #4a5568;
    padding: 0.5rem 1rem;
    background: #f7fafc;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ===============================================
   MODALER
   =============================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.5rem;
}

.modal-content p {
    color: #4a5568;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.modal-actions .btn {
    min-width: 120px;
}

/* ===============================================
   MEDDELANDEN
   =============================================== */

.error-message {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
    animation: slideDown 0.3s ease;
}

.success-message {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
    animation: slideDown 0.3s ease;
}

.info-message {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
    animation: slideDown 0.3s ease;
}

.warning-message {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
    animation: slideDown 0.3s ease;
}

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

/* ===============================================
   VIEWS/SECTIONS
   =============================================== */

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===============================================
   LISTOR
   =============================================== */

.list-item {
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.list-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transform: translateX(3px);
    border-color: #cbd5e0;
}

/* ===============================================
   BADGES
   =============================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-primary {
    background: #ebf4ff;
    color: #4c7ae4;
    border: 1px solid #c3ddfd;
}

.badge-success {
    background: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.badge-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.badge-warning {
    background: #fef5e7;
    color: #d68910;
    border: 1px solid #f9e79f;
}

/* ===============================================
   UTILITY-KLASSER
   =============================================== */

.text-center {
    text-align: center;
}

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

.text-right {
    text-align: right;
}

.text-muted {
    color: #a0aec0;
}

.text-primary {
    color: #667eea;
}

.text-danger {
    color: #f56565;
}

.text-success {
    color: #48bb78;
}

/* Margins */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Padding */
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flex utilities */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 768px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .quiz-actions {
        flex-direction: column;
    }
    
    .quiz-actions .btn {
        width: 100%;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-right {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.9rem;
    }
}