/**
 * Installer Brukere Shortcode Styles
 * [installer_brukere] shortcode styling
 */

/* Container */
.installer-brukere-manager {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    margin: 2rem 0;
}

/* Header */
.brukere-header {
    margin-bottom: 1.5rem;
}

.brukere-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brukere-count {
    font-size: 1rem;
    font-weight: 400;
    color: #64748b;
}

/* No brukere message */
.no-brukere {
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
}

/* Brukere liste */
.brukere-liste {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Bruker item */
.bruker-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bruker-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.bruker-item.has-wp-user {
    border-left: 4px solid #10b981;
}

.bruker-item.no-wp-user {
    border-left: 4px solid #f59e0b;
}

.bruker-item.status-inactive {
    opacity: 0.7;
    background: #fafafa;
}

/* Animations */
.bruker-item.item-added {
    animation: slideIn 0.3s ease;
    background: #ecfdf5;
}

.bruker-item.item-updated {
    animation: pulse 0.5s ease;
}

.bruker-item.item-removing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
        margin: 0;
        padding: 0;
        height: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Bruker info */
.bruker-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.bruker-email {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

/* Badges */
.wp-user-badge,
.no-wp-user-badge,
.admin-badge,
.manager-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.wp-user-badge {
    background: #d1fae5;
    color: #065f46;
}

.no-wp-user-badge {
    background: #fef3c7;
    color: #92400e;
}

.admin-badge {
    background: #ddd6fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}

.manager-badge {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.status-badge.status-inactive {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-icon {
    font-size: 1rem;
    line-height: 1;
}

.badge-text {
    line-height: 1;
}

/* User details */
.wp-user-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.user-id,
.user-login {
    display: inline-block;
}

/* Bruker actions */
.bruker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1rem;
    line-height: 1;
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-danger {
    color: #dc2626;
    border-color: #fecaca;
}

.btn-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.btn-unlink {
    color: #ea580c;
    border-color: #fed7aa;
}

.btn-unlink:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

.btn-toggle-status {
    color: #475569;
    border-color: #cbd5e1;
}

.btn-toggle-status.btn-deactivate {
    color: #ea580c;
    border-color: #fed7aa;
}

.btn-toggle-status.btn-deactivate:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

.btn-toggle-status.btn-activate {
    color: #059669;
    border-color: #a7f3d0;
}

.btn-toggle-status.btn-activate:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

/* Action feedback */
.action-feedback {
    display: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    animation: fadeIn 0.3s ease;
}

.action-feedback.show-success,
.action-feedback.show-error {
    display: block;
}

.action-feedback.show-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.action-feedback.show-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Add bruker section */
.add-bruker-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.add-bruker-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.add-bruker-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
}

.form-control {
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    color: #1e293b;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-text {
    font-size: 0.75rem;
    color: #64748b;
}

/* Responsive */
@media (min-width: 640px) {
    .bruker-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .bruker-info {
        flex: 1;
        min-width: 0; /* Tillat shrinking */
    }

    .bruker-actions {
        flex-shrink: 0; /* Ikke la knappene krympe */
        margin-left: 1rem;
    }

    .add-bruker-form {
        flex-direction: row;
        align-items: flex-end;
        gap: 1rem;
    }

    .form-group {
        flex: 1;
    }

    .btn-add-bruker {
        flex-shrink: 0;
    }

    /* Sørg for at input og knapp har samme høyde */
    .form-control {
        height: 2.5rem;
    }

    .btn-add-bruker {
        height: 2.5rem;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Ekstra plass for større skjermer */
@media (min-width: 1024px) {
    .bruker-item {
        padding: 1.5rem;
    }

    .bruker-actions {
        gap: 0.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }
}
